#!/usr/bin/env bash
#set -x

# ======================== !! NOTE !! ========================
#  ________ ________ ________ ________ ________ ________ ________ ________ ________     ___    ___
# |\  _____\\  _____\\  _____\\  _____\\  _____\\  _____\\  _____\\  _____\\   __  \   |\  \  /  /|
# \ \  \__/\ \  \__/\ \  \__/\ \  \__/\ \  \__/\ \  \__/\ \  \__/\ \  \__/\ \  \|\  \  \ \  \/  / /
#  \ \   __\\ \   __\\ \   __\\ \   __\\ \   __\\ \   __\\ \   __\\ \   __\\ \  \\\  \  \ \    / /
#   \ \  \_| \ \  \_| \ \  \_| \ \  \_| \ \  \_| \ \  \_| \ \  \_| \ \  \_| \ \  \\\  \  /     \/
#    \ \__\   \ \__\   \ \__\   \ \__\   \ \__\   \ \__\   \ \__\   \ \__\   \ \_______\/  /\   \
#     \|__|    \|__|    \|__|    \|__|    \|__|    \|__|    \|__|    \|__|    \|_______/__/ /\ __\
#                                                                                      |__|/ \|__|
# 注: 该脚本适用于 debian、kali、Ubuntu、Centos、RedHat、Fedora 等系列系统下
# 注: 完全适配 debian 系列系统
# 注: 基本适配 RedHat 系列系统
# 注: 适配 Centos8 和 Fedora 系统时有些小bug,但不影响使用,可以忽略
# 注: 走代理时,请确认配置好 Proxychains-ng 代理
# ======================== !! NOTE !! ========================

# ===================== 基础变量设置 =====================
P_Dir=/pentest
T_Dir=/ffffffff0x
Default_DNS=223.5.5.5
Proxy_URL="https://cdn.ffffffff0x.com/?durl=https://codeload.github.com/rofl0r/proxychains-ng/zip/master"
Porxy_OK=
Docker_OK=
error=0
F8x_Version="1.5.1 Dev(Beta1)"

# ===================== 软件版本变量设置 =====================
jdk_Version="jdk1.8.0_271"
CS_File="CobaltStrike4.1.zip"
CS_Version="CobaltStrike4.1"
AdGuardHome_Version="v0.105.2"
AdguardTeam_File="AdGuardHome_linux_amd64.tar.gz"
frp_Version="v0.36.1"
frp_File="frp_0.36.1_linux_amd64.tar.gz"
frp_Dir="frp_0.36.1_linux_amd64"
nps_Ver="v0.26.10"
nps_Install="linux_amd64_server.tar.gz"
sharry_Ver="1.6.0"
sharry_File="sharry-restserver-1.6.0.zip"
Ruby_Ver="3.0"
Ruby_Dir="ruby-3.0.0"
Ruby_Install=ruby-3.0.0.tar.gz
RustScan_Version="2.0.1"
RustScan_Install="rustscan_2.0.1_amd64.deb"
ksubdomain_Ver="v0.7"
ksubdomain_Install="ksubdomain_linux.zip"
Go_Bin=go1.15.6.linux-amd64.tar.gz
xray_Ver="1.7.1"
xray_File="xray_linux_amd64.zip"
goby_Ver="Beta1.8.239"
goby_File="goby-linux-x64-1.8.239.zip"
fscan_Ver="1.5.1"
fscan_Install="fscan_amd64"
ffuf_Ver="v1.2.1"
ffuf_Install="ffuf_1.2.1_linux_amd64.tar.gz"
Nuclei_Ver="v2.3.4"
Nuclei_Install="nuclei_2.3.4_linux_amd64.tar.gz"
rad_File="rad_linux_amd64.zip"
crawlergo_File="crawlergo_linux_amd64.zip"
Terraform_Ver="0.15.0"
Terraform_bin="terraform_0.15.0_linux_amd64.zip"
CrossC2_Ver="v2.2.1"
node_Ver="v14.16.0"
node_bin="node-v14.16.0-linux-x64.tar.xz"
node_Dir="node-v14.16.0-linux-x64"
Girsh_Ver="v0.27"
Girsh_bin="Girsh-v0.27-linux-amd64.tar.gz"
bettercap_Ver="v2.30.2"
bettercap_bin="bettercap_linux_amd64_v2.30.2.zip"
mitmproxy_Ver="6.0.2"
mitmproxy_bin="mitmproxy-6.0.2-linux.tar.gz"
naabu_bin="naabu-linux-amd64.tar.gz"
proxify_Ver="v0.0.3"
proxify_bin="proxify_0.0.3_linux_amd64.tar.gz"
clash_Ver="v1.5.0"
clash_bin="clash-linux-amd64-v1.5.0.gz"
fzf_Ver="0.27.0"
fzf_bin="fzf-0.27.0-linux_amd64.tar.gz"
subfinder_Ver="v2.4.7"
subfinder_bin="subfinder_2.4.7_linux_amd64.tar.gz"
httpx_Ver="v1.0.5"
httpx_bin="httpx_1.0.5_linux_amd64.tar.gz"
mapcidr_Ver="v0.0.6"
mapcidr_bin="mapcidr_0.0.6_linux_amd64.tar.gz"
apktool_Ver="v2.5.0"
apktool_bin="apktool_2.5.0.jar"
gau_Ver="v1.1.0"
gau_bin="gau_1.1.0_linux_amd64.tar.gz"
annie_Ver="0.10.3"
annie_bin="annie_0.10.3_Linux_64-bit.tar.gz"
nginx_Ver="1.18.0"
nginx_bin="nginx-1.18.0.tar.gz"
jadx_Ver="v1.2.0"
jadx_bin="jadx-1.2.0.zip"
rmg_Ver="v3.2.0"
rmg_bin="rmg-3.2.0-jar-with-dependencies.jar"

# ===================== 基础文件夹 =====================
Base_Dir(){

    mkdir -p /tmp > /dev/null 2>&1

    if test -d $T_Dir
    then
        Echo_INFOR "$T_Dir 文件夹已存在"
    else
        mkdir -p $T_Dir && Echo_INFOR "已新建 $T_Dir 文件夹"
    fi

    timedatectl set-timezone Asia/Shanghai > /dev/null 2>&1 && Echo_INFOR "当前时区已设置为 Asia/Shanghai" || Echo_ERROR "时区设置失败"

    date +"%Y-%m-%d" > /tmp/f8x_error.log

}

# ===================== 除锁模块 =====================
Rm_Lock(){

    case $Linux_Version in
        *"CentOS"*|*"RedHat"*|*"Fedora"*)
            rm -f /var/run/yum.pid 1> /dev/null 2>> /tmp/f8x_error.log
            rm -f /var/cache/dnf/metadata_lock.pid 1> /dev/null 2>> /tmp/f8x_error.log
            ;;
        *"Kali"*|*"Ubuntu"*|*"Debian"*)
            rm -rf /var/cache/apt/archives/lock > /dev/null 2>&1
            rm -rf /var/lib/dpkg/lock-frontend > /dev/null 2>&1
            rm -rf /var/lib/dpkg/lock > /dev/null 2>&1
            rm -rf /var/lib/apt/lists/lock > /dev/null 2>&1
            apt-get --fix-broken install > /dev/null 2>&1
            rm -rf /var/cache/apt/archives/lock > /dev/null 2>&1
            rm -rf /var/lib/dpkg/lock-frontend > /dev/null 2>&1
            rm -rf /var/lib/dpkg/lock > /dev/null 2>&1
            rm -rf /var/lib/apt/lists/lock > /dev/null 2>&1
            ;;
        *) ;;
    esac

}

Docker_Check(){

    case $(ls -alh /.dockerenv 2>> /tmp/f8x_error.log) in
    *"docker"*)
        case $(cat /proc/1/cgroup 2>> /tmp/f8x_error.log) in
        *"docker"*)
            Echo_ALERT "当前运行在 Docker 环境下,f8x 可能会有无法预期的问题,见谅"
            Docker_OK=1
            ;;
        esac
        ;;
    esac

}

# ===================== 依赖检查模块 =====================
Base_Check(){

    Echo_ALERT "正在检查各项依赖"
    unzip -v 1> /dev/null 2>> /tmp/f8x_error.log || error=1
    wget --version 1> /dev/null 2>> /tmp/f8x_error.log || error=1
    curl --version 1> /dev/null 2>> /tmp/f8x_error.log || error=1
    vim --version 1> /dev/null 2>> /tmp/f8x_error.log || error=1
    git --version 1> /dev/null 2>> /tmp/f8x_error.log || error=1

    if [ $error == 1 ]
    then
        Echo_ALERT "依赖项不通过,即将自动安装基本依赖"
        Base_Install
        error=0
    else
        Echo_INFOR "基础依赖项正常"
    fi

}

Py_Check(){

    Echo_ALERT "正在检测 Python 环境可用性"
    python2 -V 1> /dev/null 2>> /tmp/f8x_error.log || error=1
    python3 -V 1> /dev/null 2>> /tmp/f8x_error.log || error=1
    #pip2 -V 1> /dev/null 2>> /tmp/f8x_error.log || error=1
    pip3 -V 1> /dev/null 2>> /tmp/f8x_error.log || error=1

    if [ $error == 1 ]
    then
        Echo_ALERT "开发环境检查不通过,即将自动安装 Python 环境"
        Python3_Install
        Python2_Install
        error=0
    else
        Echo_INFOR "开发环境正常"
    fi

}

pip2_Check(){

    pip2 -V 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_INFOR "pip2 依赖项正常"
    else
        Echo_ALERT "依赖项不通过,即将自动安装 pip2"
        Python2_Install
    fi
}

pip3_Check(){

    pip3 -V 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_INFOR "pip3 依赖项正常"
    else
        Echo_ALERT "依赖项不通过,即将自动安装 pip3"
        Python3_Install
    fi
}

nn_Check(){

    echo -e "\033[1;33m\n>> 正在检测 npm & nodejs 可用性\n\033[0m"
    npm version 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "npm 可用" || error=1
    node --version 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "node $(node --version) 可用" || error=1

    if [ $error == 1 ]
    then
        Echo_ALERT "依赖项不通过,即将自动安装 npm & nodejs"
        nn_Install
        error=0
    else
        Echo_INFOR "npm & nodejs 依赖项正常"
    fi

}

Rust_Check(){

    echo -e "\033[1;33m\n>> 正在检测 Rust 可用性\n\033[0m"
    cargo -V 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_INFOR "Rust 依赖项正常"
    else
        Echo_ALERT "依赖项不通过,即将自动安装 Rust"
        Rust_Install
    fi

}

# ===================== 简写 =====================
Echo_INFOR(){

    echo -e "\033[1;36m$(date +"%H:%M:%S")\033[0m \033[1;32m[INFOR]\033[0m - \033[1;32m$1\033[0m"

}

Echo_ALERT(){

    echo -e "\033[1;36m$(date +"%H:%M:%S")\033[0m \033[1;33m[ALERT]\033[0m - \033[1;33m$1\033[0m"

}

Echo_ERROR(){

    echo -e "\033[1;36m$(date +"%H:%M:%S")\033[0m \033[1;31m[ERROR]\033[0m - \033[1;31m$1\n\033[0m"

}

Echo_ERROR2(){

    Echo_ERROR "$name 下载失败,请检查网络是否可达,proxychains4 配置的代理服务器是否可用"

}

Echo_ERROR3(){

    Echo_ERROR "$name 安装失败,请查看日志 /tmp/f8x_error.log"

}

Install_Switch(){
    case $Linux_Version in
        *"CentOS"*|*"RedHat"*|*"Fedora"*)
            yum install -y $1 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $1 " || Echo_ERROR "安装 $1 失败,请查看日志 /tmp/f8x_error.log"
            ;;
        *"Kali"*|*"Ubuntu"*|*"Debian"*)
            apt-get install -y $1 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $1 " || Echo_ERROR "安装 $1 失败,请查看日志 /tmp/f8x_error.log"
            ;;
        *) ;;
    esac
}

Install_Switch2(){

    apt-get install -yq --no-install-recommends $1 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $1 " || Echo_ERROR "安装 $1 失败,请查看日志 /tmp/f8x_error.log"

}

Install_Switch3(){

    python2 -m pip install $1 > /dev/null 2>&1 && Echo_INFOR "已安装 $1 " || Echo_ERROR "安装 $1 模块失败! 请尝试更换 pip 代理或检查 python2 是否已安装!"

}

Install_Switch4(){

    pip3 install $1 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $1 " || Echo_ERROR "安装 $1 模块失败,请查看日志 /tmp/f8x_error.log"

}

Install_Switch5(){

    python3 -m pip install $1 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $1 " || Echo_ERROR "安装 $1 模块失败,请查看日志 /tmp/f8x_error.log"

}

# ===================== 代理开关 =====================
Porxy_Switch(){

    if test -e /tmp/IS_CI
    then
        Echo_INFOR "IS_CI"
    else
        echo -e "\033[1;33m\n>> 运行时是否需要走代理? [y/N,默认No] \033[0m" && read -r input
        case $input in
            [yY][eE][sS]|[Yy])
                export GOPROXY=https://goproxy.io,direct
                if test -e /etc/proxychains.conf
                then
                    Echo_INFOR "正在调用 Proxychains-ng"
                    Porxy_OK=proxychains4
                else
                    Echo_ALERT "未检测到 Proxychains-ng,正在执行自动安装脚本"
                    Proxychains_Install
                    Porxy_OK=proxychains4
                fi
                ;;
            *)
                Echo_INFOR "Pass~"
                ;;
        esac
    fi

}

Banner(){

    echo -e "\033[1;34m  _______   ___   ___   ___ \033[0m"
    echo -e "\033[1;32m |   ____| / _ \  \  \ /  / \033[0m"
    echo -e "\033[1;36m |  |__   | (_) |  \  V  / \033[0m"
    echo -e "\033[1;31m |   __|   > _ <    >   < \033[0m"
    echo -e "\033[1;35m |  |     | (_) |  /  .  \ \033[0m"
    echo -e "\033[1;33m |__|      \___/  /__/ \__\ \n\033[0m"

}

# ===================== Default =====================
Info(){

    case $(cat /etc/*-release | head -n 1) in
        *"Kali"*|*"kali"*)
            Linux_Version="Kali"
            case $(cat /etc/*-release | head -n 4) in
                *"2021"*)
                    Linux_Version_Num="kali-rolling"
                    Linux_Version_Name="buster"
                    ;;
                *"2020"*)
                    Linux_Version_Num="kali-rolling"
                    Linux_Version_Name="buster"
                    ;;
                *)
                    Linux_Version_Num="kali-rolling"
                    Linux_Version_Name="stretch"
                    ;;
            esac
            ;;
        *"Ubuntu"*|*"ubuntu"*)
            Linux_Version="Ubuntu"
            case $(cat /etc/*-release | head -n 4) in
                *"hirsute"*)
                    Linux_Version_Num="21.04"
                    Linux_Version_Name="hirsute"
                    ;;
                *"groovy"*)
                    Linux_Version_Num="20.10"
                    Linux_Version_Name="groovy"
                    ;;
                *"focal"*)
                    Linux_Version_Num="20.04"
                    Linux_Version_Name="focal"
                    ;;
                *"eoan"*)
                    Linux_Version_Num="19.10"
                    Linux_Version_Name="eoan"
                    ;;
                *"bionic"*)
                    Linux_Version_Num="18.04"
                    Linux_Version_Name="bionic"
                    ;;
                *"xenial"*)
                    Linux_Version_Num="16.04"
                    Linux_Version_Name="xenial"
                    ;;
                *"vivid"*)
                    Linux_Version_Num="15.04"
                    Linux_Version_Name="vivid"
                    ;;
                *"trusty"*)
                    Linux_Version_Num="14.04"
                    Linux_Version_Name="trusty"
                    ;;
                *"precise"*)
                    Linux_Version_Num="12.04"
                    Linux_Version_Name="precise"
                    ;;
                *)
                    Echo_ERROR "未知版本"
                    exit 1
                    ;;
            esac
            ;;
        *"Debian"*|*"debian"*)
            Linux_Version="Debian"
            case $(cat /etc/*-release | head -n 4) in
                *"bullseye"*)
                    Linux_Version_Num="11"
                    Linux_Version_Name="bullseye"
                    ;;
                *"buster"*)
                    Linux_Version_Num="10"
                    Linux_Version_Name="buster"
                    ;;
                *"stretch"*)
                    Linux_Version_Num="9"
                    Linux_Version_Name="stretch"
                    ;;
                *"jessie"*)
                    Linux_Version_Num="8"
                    Linux_Version_Name="jessie"
                    ;;
                *"wheezy"*)
                    Linux_Version_Num="7"
                    Linux_Version_Name="wheezy"
                    ;;
                *)
                    Echo_ERROR "未知版本"
                    exit 1
                    ;;
            esac
            ;;
        *"CentOS"*|*"centos"*)
            echo -e "\033[1;31m珍惜生命,少用 Centos\033[0m"
            Linux_Version="CentOS"
            case $(cat /etc/*-release | head -n 1) in
                *"release 8"*)
                    Linux_Version_Num="8"
                    Linux_Version_Name=""
                    ;;
                *"release 7"*)
                    Linux_Version_Num="7"
                    Linux_Version_Name=""
                    ;;
                *"release 6"*)
                    Linux_Version_Num="6"
                    Linux_Version_Name=""
                    ;;
                *)
                    Echo_ERROR "未知版本"
                    exit 1
                    ;;
            esac
            ;;
        *"RedHat"*|*"redhat"*)
            Linux_Version="RedHat" ;;
        *"Fedora"*|*"fedora"*)
            Linux_Version="Fedora"
            case $(cat /etc/*-release | head -n 1) in
                *"release 34"*)
                    Linux_Version_Num="34"
                    Linux_Version_Name=""
                    ;;
                *"release 33"*)
                    Linux_Version_Num="33"
                    Linux_Version_Name=""
                    ;;
                *"release 32"*)
                    Linux_Version_Num="32"
                    Linux_Version_Name=""
                    ;;
                *)
                    Echo_ERROR "未知版本"
                    exit 1
                    ;;
            esac
            ;;
        *)
            Echo_ERROR "未知版本"
            echo -e "\033[1;33m\n请手动输入你的系统发行版 Kali[k] Ubuntu[u] Debian[d] Centos[c] RedHat[r] Fedora[f]\033[0m" && read -r input
            case $input in
                [kK])
                    Linux_Version="Kali" ;;
                [uU])
                    Linux_Version="Ubuntu"
                    echo -e "\033[1;33m\n请手动输入你的系统版本号 [21.04] [20.10] [20.04] [19.10] [18.04] [16.04] [15.04] [14.04] [12.04]\033[0m" && read -r input
                    Linux_Version_Name=$input
                    ;;
                [dD])
                    Linux_Version="Debian"
                    echo -e "\033[1;33m\n请手动输入你的系统版本号 [11] [10] [9] [8] [7]\033[0m" && read -r input
                    Linux_Version_Name=$input
                    ;;
                [cC])
                    Linux_Version="CentOS"
                    echo -e "\033[1;33m\n请手动输入你的系统版本号 [8] [7] [6]\033[0m" && read -r input
                    Linux_Version_Name=$input
                    ;;
                [rR])
                    Linux_Version="RedHat" ;;
                [fF])
                    Linux_Version="Fedora"
                    echo -e "\033[1;33m\n请手动输入你的系统版本号 [34] [33] [32]\033[0m" && read -r input
                    Linux_Version_Name=$input
                    ;;
                *)
                    Echo_ERROR "未知版本"
                    exit 1
                    ;;
            esac
            ;;
    esac

}

Info2(){

    echo -e "\033[1;32m当前发行版 :\033[0m \033[1;35m$Linux_Version $Linux_Version_Num $Linux_Version_Name \033[0m"
    echo -e "\033[1;32m当前主机名 :\033[0m \033[1;35m$(hostname) \033[0m"
    echo -e "\033[1;32m当前用户 :\033[0m \033[1;35m$(whoami) \033[0m"
    echo -e "\033[1;32m当前 UID :\033[0m \033[1;35m$UID \033[0m"
    echo -e "\033[1;32m当前日期 :\033[0m \033[1;35m$(date +"%Y-%m-%d") \033[0m"
    echo -e "\033[1;32m当前时间 :\033[0m \033[1;35m$(date +"%H:%M:%S") \033[0m"
    echo -e "\033[1;32m开机运行时长 :\033[0m \033[1;35m$(uptime | awk '{print $3 $4}' | sed 's/\,.*$//g') \033[0m"

    case $Linux_Version in
        *"CentOS"*|*"RedHat"*|*"Fedora"*)
            if test -e /var/log/secure
            then
                echo -e "\033[1;32m最近登录 IP :\033[0m"
                echo -e "\033[1;35m$(grep 'Accepted' /var/log/secure | awk '{print $11}' | sort | uniq -c | sort -nr) \033[0m"
            fi
            ;;
        *"Kali"*)
                echo "" > /dev/null
            ;;
        *)
            if test -e /var/log/auth.log
            then
                echo -e "\033[1;32m最近登录 IP :\033[0m"
                echo -e "\033[1;35m$(grep "Accepted " /var/log/auth.log | awk '{print $11}' | sort | uniq -c | sort -nr) \033[0m"
            fi
            ;;

    esac

    echo -e "\033[1;32mf8x 当前版本 :\033[0m \033[1;35m$F8x_Version \033[0m"

}

# ===================== 修改 apt 源 =====================
Update_APT_Mirror(){

    Echo_INFOR "正在更新 $Linux_Version apt 源"

    case $Linux_Version in
        *"Kali"*)
            Echo_INFOR "kali"
            Echo_INFOR "已备份本地 apt 源"
            Update_kali_Mirror > /dev/null
            ;;
        *"Ubuntu"*)
            case $Linux_Version_Num in
                "21.04")
                    Echo_INFOR "Ubuntu21.04"
                    Echo_INFOR "已备份本地 apt 源"
                    Update_Ubuntu2104_Mirror > /dev/null
                    ;;
                "20.10")
                    Echo_INFOR "Ubuntu20.10"
                    Echo_INFOR "已备份本地 apt 源"
                    Update_Ubuntu2010_Mirror > /dev/null
                    ;;
                "20.04")
                    Echo_INFOR "Ubuntu20.04"
                    Echo_INFOR "已备份本地 apt 源"
                    Update_Ubuntu2004_Mirror > /dev/null
                    ;;
                "19.10")
                    Echo_INFOR "Ubuntu19.10"
                    Echo_INFOR "已备份本地 apt 源"
                    Update_Ubuntu1910_Mirror > /dev/null
                    ;;
                "18.04")
                    Echo_INFOR "Ubuntu18.04"
                    Echo_INFOR "已备份本地 apt 源"
                    Update_Ubuntu1804_Mirror > /dev/null
                    ;;
                "16.04")
                    Echo_INFOR "Ubuntu16.04"
                    Echo_INFOR "已备份本地 apt 源"
                    Update_Ubuntu1604_Mirror > /dev/null
                    ;;
                "15.04")
                    Echo_INFOR "Ubuntu15.04"
                    Echo_INFOR "已备份本地 apt 源"
                    Update_Ubuntu1504_Mirror > /dev/null
                    ;;
                "14.04")
                    Echo_INFOR "Ubuntu14.04"
                    Echo_INFOR "已备份本地 apt 源"
                    Update_Ubuntu1404_Mirror > /dev/null
                    ;;
                "12.04")
                    Echo_INFOR "Ubuntu12.04"
                    Echo_INFOR "已备份本地 apt 源"
                    Update_Ubuntu1204_Mirror > /dev/null
                    ;;
                *)
                    Echo_ERROR "版本错误,此项 pass"
                    ;;
            esac
            ;;
        *"Debian"*)
            case $Linux_Version_Num in
                "11")
                    Echo_INFOR "Debian11"
                    Echo_INFOR "已备份本地 apt 源"
                    Update_Debian11_Mirror > /dev/null
                    ;;
                "10")
                    Echo_INFOR "Debian10"
                    Echo_INFOR "已备份本地 apt 源"
                    Update_Debian10_Mirror > /dev/null
                    ;;
                "9")
                    Echo_INFOR "Debian9"
                    Echo_INFOR "已备份本地 apt 源"
                    Update_Debian9_Mirror > /dev/null
                    ;;
                "8")
                    Echo_INFOR "Debian8"
                    Echo_INFOR "已备份本地 apt 源"
                    Update_Debian8_Mirror > /dev/null
                    ;;
                "7")
                    Echo_INFOR "Debian7"
                    Echo_INFOR "已备份本地 apt 源"
                    Update_Debian7_Mirror > /dev/null
                    ;;
                *)
                    Echo_ERROR "版本错误,此项 pass"
                    ;;
            esac
            ;;
    esac

    Echo_ALERT "正在更新 apt 软件包列表,该步骤可能运行较长时间,请耐心等待,若长时间没有反应,请手动按下回车键"
    Rm_Lock
    apt-get update 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "更新 apt 软件包列表失败,请查看日志 /tmp/f8x_error.log"

}

# ===================== 修改 kali apt 源 =====================
Update_kali_Mirror(){
rm -f /etc/apt/sources.list.bak > /dev/null 2>&1 && cp /etc/apt/sources.list /etc/apt/sources.list.bak 1> /dev/null 2>> /tmp/f8x_error.log
tee /etc/apt/sources.list <<-'EOF'
# 默认注释了源码镜像以提高 apt update 速度，如有需要可自行取消注释
deb https://mirrors.aliyun.com/kali kali-rolling main non-free contrib
# deb-src https://mirrors.aliyun.com/kali kali-rolling main non-free contrib
deb http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
deb http://http.kali.org/kali kali-rolling main non-free contrib
# deb-src http://http.kali.org/kali kali-rolling main non-free contrib
EOF

}

# ===================== 修改 Ubuntu apt 源 =====================
Update_Ubuntu2104_Mirror(){
rm -f /etc/apt/sources.list.bak > /dev/null 2>&1 && cp /etc/apt/sources.list /etc/apt/sources.list.bak 1> /dev/null 2>> /tmp/f8x_error.log
tee /etc/apt/sources.list <<-'EOF'
# 默认注释了源码镜像以提高 apt update 速度，如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy-security main restricted universe multiverse
EOF

}

Update_Ubuntu2010_Mirror(){
rm -f /etc/apt/sources.list.bak > /dev/null 2>&1 && cp /etc/apt/sources.list /etc/apt/sources.list.bak 1> /dev/null 2>> /tmp/f8x_error.log
tee /etc/apt/sources.list <<-'EOF'
# 默认注释了源码镜像以提高 apt update 速度，如有需要可自行取消注释
deb http://mirrors.aliyun.com/ubuntu/ groovy main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ groovy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ groovy-security main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ groovy-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ groovy-updates main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ groovy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ groovy-backports main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ groovy-backports main restricted universe multiverse
EOF

}

Update_Ubuntu2004_Mirror(){
rm -f /etc/apt/sources.list.bak > /dev/null 2>&1 && cp /etc/apt/sources.list /etc/apt/sources.list.bak 1> /dev/null 2>> /tmp/f8x_error.log
tee /etc/apt/sources.list <<-'EOF'
# 默认注释了源码镜像以提高 apt update 速度，如有需要可自行取消注释
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
EOF

}

Update_Ubuntu1910_Mirror(){
rm -f /etc/apt/sources.list.bak > /dev/null 2>&1 && cp /etc/apt/sources.list /etc/apt/sources.list.bak 1> /dev/null 2>> /tmp/f8x_error.log
tee /etc/apt/sources.list <<-'EOF'
# 默认注释了源码镜像以提高 apt update 速度，如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-security main restricted universe multiverse
EOF

}

Update_Ubuntu1804_Mirror(){
rm -f /etc/apt/sources.list.bak > /dev/null 2>&1 && cp /etc/apt/sources.list /etc/apt/sources.list.bak 1> /dev/null 2>> /tmp/f8x_error.log
tee /etc/apt/sources.list <<-'EOF'
# 默认注释了源码镜像以提高 apt update 速度，如有需要可自行取消注释
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
EOF

}

Update_Ubuntu1604_Mirror(){
rm -f /etc/apt/sources.list.bak > /dev/null 2>&1 && cp /etc/apt/sources.list /etc/apt/sources.list.bak 1> /dev/null 2>> /tmp/f8x_error.log
tee /etc/apt/sources.list <<-'EOF'
# 默认注释了源码镜像以提高 apt update 速度，如有需要可自行取消注释
deb http://mirrors.aliyun.com/ubuntu/ xenial main
# deb-src http://mirrors.aliyun.com/ubuntu/ xenial main
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
# deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
# deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
# deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
# deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
# deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
EOF

}

Update_Ubuntu1504_Mirror(){
rm -f /etc/apt/sources.list.bak > /dev/null 2>&1 && cp /etc/apt/sources.list /etc/apt/sources.list.bak 1> /dev/null 2>> /tmp/f8x_error.log
tee /etc/apt/sources.list <<-'EOF'
# 默认注释了源码镜像以提高 apt update 速度，如有需要可自行取消注释
deb http://mirrors.aliyun.com/ubuntu/ vivid main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-backports main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ vivid main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ vivid-security main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ vivid-updates main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ vivid-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ vivid-backports main restricted universe multiverse
EOF

}

Update_Ubuntu1404_Mirror(){
rm -f /etc/apt/sources.list.bak > /dev/null 2>&1 && cp /etc/apt/sources.list /etc/apt/sources.list.bak 1> /dev/null 2>> /tmp/f8x_error.log
tee /etc/apt/sources.list <<-'EOF'
# 默认注释了源码镜像以提高 apt update 速度，如有需要可自行取消注释
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
EOF

}

Update_Ubuntu1204_Mirror(){
rm -f /etc/apt/sources.list.bak > /dev/null 2>&1 && cp /etc/apt/sources.list /etc/apt/sources.list.bak 1> /dev/null 2>> /tmp/f8x_error.log
tee /etc/apt/sources.list <<-'EOF'
# 默认注释了源码镜像以提高 apt update 速度，如有需要可自行取消注释
deb http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse
EOF

}


# ===================== 修改 Debian11 apt 源 =====================
Update_Debian11_Mirror(){
rm -f /etc/apt/sources.list.bak > /dev/null 2>&1 && cp /etc/apt/sources.list /etc/apt/sources.list.bak 1> /dev/null 2>> /tmp/f8x_error.log
tee /etc/apt/sources.list <<-'EOF'
# 默认注释了源码镜像以提高 apt update 速度，如有需要可自行取消注释
deb http://mirrors.aliyun.com/debian/ bullseye main non-free contrib
# deb-src http://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb http://mirrors.aliyun.com/debian-security bullseye/updates main
# deb-src http://mirrors.aliyun.com/debian-security bullseye/updates main
deb http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
# deb-src http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
# deb-src http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
EOF

}

# ===================== 修改 Debian10 apt 源 =====================
Update_Debian10_Mirror(){
rm -f /etc/apt/sources.list.bak > /dev/null 2>&1 && cp /etc/apt/sources.list /etc/apt/sources.list.bak 1> /dev/null 2>> /tmp/f8x_error.log
tee /etc/apt/sources.list <<-'EOF'
# 默认注释了源码镜像以提高 apt update 速度，如有需要可自行取消注释
deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
# deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
# deb-src http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
# deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
# deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
EOF

}

Update_Debian9_Mirror(){
rm -f /etc/apt/sources.list.bak > /dev/null 2>&1 && cp /etc/apt/sources.list /etc/apt/sources.list.bak 1> /dev/null 2>> /tmp/f8x_error.log
tee /etc/apt/sources.list <<-'EOF'
# 默认注释了源码镜像以提高 apt update 速度，如有需要可自行取消注释
deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib
# deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib
deb http://mirrors.aliyun.com/debian-security stretch/updates main
# deb-src http://mirrors.aliyun.com/debian-security stretch/updates main
deb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
# deb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
# deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
EOF

}

Update_Debian8_Mirror(){
rm -f /etc/apt/sources.list.bak > /dev/null 2>&1 && cp /etc/apt/sources.list /etc/apt/sources.list.bak 1> /dev/null 2>> /tmp/f8x_error.log
tee /etc/apt/sources.list <<-'EOF'
# 默认注释了源码镜像以提高 apt update 速度，如有需要可自行取消注释
deb http://mirrors.aliyun.com/debian/ jessie main non-free contrib
deb http://mirrors.aliyun.com/debian/ jessie-proposed-updates main non-free contrib
# deb-src http://mirrors.aliyun.com/debian/ jessie main non-free contrib
# deb-src http://mirrors.aliyun.com/debian/ jessie-proposed-updates main non-free contrib
EOF

}

Update_Debian7_Mirror(){
rm -f /etc/apt/sources.list.bak > /dev/null 2>&1 && cp /etc/apt/sources.list /etc/apt/sources.list.bak 1> /dev/null 2>> /tmp/f8x_error.log
tee /etc/apt/sources.list <<-'EOF'
# 默认注释了源码镜像以提高 apt update 速度，如有需要可自行取消注释
deb http://mirrors.aliyun.com/debian/ wheezy main non-free contrib
deb http://mirrors.aliyun.com/debian/ wheezy-proposed-updates main non-free contrib
# deb-src http://mirrors.aliyun.com/debian/ wheezy main non-free contrib
# deb-src http://mirrors.aliyun.com/debian/ wheezy-proposed-updates main non-free contrib
EOF

}

# ===================== 修改 YUM 源 =====================
Update_YUM_Mirror(){

    Echo_ALERT "正在更新 $Linux_Version yum 源"

    case $Linux_Version in
        *"CentOS"*)
            Update_CentOS_Mirror
            Update_EPEL_Mirror
            ;;
        *"RedHat"*)
            Echo_INFOR "RedHat Pass~"
            ;;
        *"Fedora"*)
            Echo_INFOR "Fedora"
            rm -f /etc/yum.repos.d/fedora.repo.repo.bak > /dev/null 2>&1 && cp /etc/yum.repos.d/fedora.repo /etc/yum.repos.d/fedora.repo.bak 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已备份本地 Yum 源"
            curl -o /etc/yum.repos.d/fedora.repo http://mirrors.aliyun.com/repo/fedora.repo 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已下载 aliyun Yum 源" || Echo_ERROR "aliyun Yum 源下载失败,请查看日志 /tmp/f8x_error.log"
            curl -o /etc/yum.repos.d/fedora-updates.repo http://mirrors.aliyun.com/repo/fedora-updates.repo 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已下载 aliyun Yum update 源" || Echo_ERROR "aliyun Yum update 源下载失败,请查看日志 /tmp/f8x_error.log"
            ;;
    esac

    Echo_ALERT "正在更新 yum 缓存,该步骤可能运行较长时间,请耐心等待,若长时间没有反应,请手动按下回车键"
    yum clean all 1> /dev/null 2>> /tmp/f8x_error.log
    Rm_Lock

    case $Linux_Version in
        *"Fedora"*)
            Echo_ALERT "年轻人少用 Fedora ＞﹏＜"
            ;;
        *)
            yum makecache 1> /dev/null 2>> /tmp/f8x_error.log /dev/null || Echo_ERROR "Yum makecache失败,请查看日志 /tmp/f8x_error.log"
            ;;
    esac

}

# ===================== 修改 CentOS EPEL 源 =====================
Update_EPEL_Mirror(){

    if test -e /etc/yum.repos.d/epel.repo
    then
        Echo_INFOR "EPEL 源已安装"
    else
        Echo_ALERT "未监测到 epel 源,正在自动安装"
        Rm_Lock
        case $Linux_Version_Num in
            8)
                yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已下载 aliyun EPEL 源" || Echo_ERROR "aliyun EPEL 源下载失败,请查看日志 /tmp/f8x_error.log"
                sed -i 's|^#baseurl=https://download.fedoraproject.org/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
                sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*
                ;;
            7)
                curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已下载 aliyun EPEL 源" || Echo_ERROR "aliyun EPEL 源下载失败,请查看日志 /tmp/f8x_error.log"
                ;;
            6)
                curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已下载 aliyun EPEL 源" || Echo_ERROR "aliyun EPEL 源下载失败,请查看日志 /tmp/f8x_error.log"
                ;;
            *)
                Echo_ERROR "版本错误,此项 pass"
                ;;
        esac
    fi

}

# ===================== 修改 CentOS YUM 源 =====================
Update_CentOS_Mirror(){

    case $Linux_Version_Num in
        8)
            rm -f /etc/yum.repos.d/CentOS-Base.repo.bak 1> /dev/null 2>> /tmp/f8x_error.log && cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已备份本地 Yum 源"
            curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已下载 aliyun Yum 源" || Echo_ERROR "aliyun Yum 源下载失败,请查看日志 /tmp/f8x_error.log"
            ;;
        7)
            rm -f /etc/yum.repos.d/CentOS-Base.repo.bak 1> /dev/null 2>> /tmp/f8x_error.log && cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已备份本地 Yum 源"
            curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已下载 aliyun Yum 源" || Echo_ERROR "aliyun Yum 源下载失败,请查看日志 /tmp/f8x_error.log"
            ;;
        6)
            rm -f /etc/yum.repos.d/CentOS-Base.repo.bak 1> /dev/null 2>> /tmp/f8x_error.log && cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已备份本地 Yum 源"
            curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.repo 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已下载 aliyun Yum 源" || Echo_ERROR "aliyun Yum 源下载失败,请查看日志 /tmp/f8x_error.log"
            ;;
        *)
            Echo_ERROR "版本错误,此项 pass"
            ;;
    esac

}

# ===================== 修改软件包源 =====================
Mirror(){

    case $Linux_Version in
        *"CentOS"*|*"RedHat"*|*"Fedora"*)
            echo -e "\033[1;33m\n>> 检测系统为 RedHat系,是否需要更新 yum 源? [Y/n,默认Yes]\033[0m" && read -r input
            case $input in
                [nN][oO]|[nN])
                    Echo_INFOR "Pass~"
                    ;;
                *)
                    Update_YUM_Mirror
                    Echo_INFOR "yum 源已更新"
                    ;;
            esac
            ;;
        *"Kali"*|*"Ubuntu"*|*"Debian"*)
            echo -e "\033[1;33m\n>> 检测系统为 Debian系,是否需要更新 apt 源? [Y/n,默认Yes]\033[0m" && read -r input
            case $input in
                [nN][oO]|[nN])
                    Echo_INFOR "Pass~"
                    ;;
                *)
                    Update_APT_Mirror
                    Echo_INFOR "apt 源已更新"
                    ;;

            esac
            ;;
        *)
            Echo_ERROR "未知版本,更新软件包源失败"
            ;;
    esac

}

# ===================== 检查 DNS IP 格式 =====================
Change_DNS_IP(){

    read -r input

    case $input in
        [nN][oO]|[nN])
            Echo_INFOR "Pass~"
            ;;
        *)
            echo -e "\033[5;33m请输入 DNS 服务器地址 [默认为 $Default_DNS]\033[0m" && read -r input

            VALID_CHECK=$(echo "$input"|awk -F. '$1<=255&&$2<=255&&$3<=255&&$4<=255{print "yes"}')
            if echo "$input"|grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$">/dev/null; then
                if [ "${VALID_CHECK:-no}" == "yes" ]; then
                    Default_DNS=$input
                    Change_DNS
                else
                    Echo_ERROR "$input 不可用!"
                    Change_DNS
                fi
            else
                Echo_ERROR "$input 不可用!"
                Change_DNS
            fi
            ;;
    esac

}

# ===================== 更新 DNS =====================
Change_DNS(){

    echo "nameserver $Default_DNS" > /etc/resolv.conf
    Echo_INFOR "默认 DNS 已配置为: $Default_DNS"

}

# ===================== 安装 DNS =====================
DNS_T00ls(){

    case $Linux_Version in
        *"CentOS"*|*"RedHat"*|*"Fedora"*)
            Echo_INFOR "RedHat 系没有 resolvconf ,本项 Pass"
            ;;
        *"Kali"*|*"Ubuntu"*|*"Debian"*)
            Rm_Lock
            Install_Switch "resolvconf"
            echo "nameserver $Default_DNS" > /etc/resolvconf/resolv.conf.d/head
            resolvconf -u ;;
        *) ;;
    esac

}

# ===================== 安装 Proxychains-ng =====================
Proxychains_Install(){

    Rm_Lock
    Install_Switch "gcc"
    Install_Switch "git"
    Install_Switch "vim"
    Install_Switch "make"
    Install_Switch "wget"
    Install_Switch "zip"
    Install_Switch "unzip"
    case $Linux_Version in
        *"CentOS"*|*"RedHat"*|*"Fedora"*)
            Install_Switch "gcc-c++"
            ;;
        *"Kali"*|*"Ubuntu"*|*"Debian"*)
            Install_Switch "g++"
            ;;
        *) ;;
    esac

    case $Linux_Version in
        *"Kali"*)
            rm -f /etc/proxychains.conf > /dev/null 2>&1
            ;;
        *) ;;
    esac

    if test -e /etc/proxychains.conf
    then
        Echo_ALERT "Proxychains-ng 已安装"
    else
        echo -e "\033[1;33m\n>> 是否需要从 ffffffff0x.com 安装 proxychains-ng [Y/n,默认Yes]\033[0m" && read -r input

        case $input in
            [nN][oO]|[nN])
                cd $T_Dir && rm -rf proxychains-ng* > /dev/null 2>&1 && git clone ${GitPorxy}https://github.com/rofl0r/proxychains-ng.git $T_Dir/proxychains-ng 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已从 github.com 下载完安装包"
                ;;
            *)
                cd $T_Dir && rm -rf proxychains-ng* > /dev/null 2>&1 && wget -O proxychains-ng.zip "$Proxy_URL" > /dev/null 2>&1 && Echo_INFOR "已从 ffffffff0x.com 下载完安装包"
                unzip proxychains-ng.zip 1> /dev/null 2>> /tmp/f8x_error.log && rm -f proxychains-ng.zip > /dev/null 2>&1
                mv proxychains-ng-master proxychains-ng
                ;;
        esac

        chmod -R 777 $T_Dir/proxychains-ng 1> /dev/null 2>> /tmp/f8x_error.log
        cd $T_Dir/proxychains-ng && chmod +x configure 1> /dev/null 2>> /tmp/f8x_error.log
        ./configure 1> /dev/null 2>> /tmp/f8x_error.log
        chmod +x ./tools/install.sh 1> /dev/null 2>> /tmp/f8x_error.log
        make 1> /dev/null 2>> /tmp/f8x_error.log && make install 1> /dev/null 2>> /tmp/f8x_error.log
        cp $T_Dir/proxychains-ng/src/proxychains.conf /etc/proxychains.conf
        cd .. && rm -rf proxychains-ng > /dev/null 2>&1
        vim /etc/proxychains.conf
        Echo_INFOR "已安装 Proxychains-ng,若需要更改代理设置,请修改 /etc/proxychains.conf 文件最后一行"
    fi

}

# ===================== pip 代理 =====================
pip_Proxy(){

mkdir -p ~/.pip/
tee ~/.pip/pip.conf <<-'EOF'
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host=mirrors.aliyun.com
EOF

}

# ===================== docker 代理 =====================
Docker_Proxy(){

mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
}
EOF

}

# ===================== 安装基础工具 =====================
Base_Tools(){

    case $Linux_Version in
        *"CentOS"*)
            Update_EPEL_Mirror;;
        *) ;;
    esac

    Rm_Lock

    case $Linux_Version in
        *"CentOS"*|*"RedHat"*|*"Fedora"*)
            Install_Switch "yum-utils"
            Install_Switch "gcc-c++"
            Install_Switch "openssl-devel"
            Install_Switch "kernel-devel"
            Install_Switch "dnf"
            ;;
        *"Kali"*|*"Ubuntu"*|*"Debian"*)
            apt-get update 1> /dev/null 2>> /tmp/f8x_error.log
            Install_Switch "zip"
            Install_Switch "g++"
            Install_Switch "p7zip-full"
            Install_Switch "apt-transport-https"
            Install_Switch "ca-certificates"
            Install_Switch "libssl-dev"
            Install_Switch "libssh2-1-dev"
            Install_Switch "aptitude"
            Install_Switch "libcurl4-openssl-dev"
            ;;
        *) ;;
    esac

    Install_Switch "vim"
    Install_Switch "make"
    Install_Switch "cmake"
    Install_Switch "gcc"
    Install_Switch "git"
    Install_Switch "curl"
    Install_Switch "wget"
    Install_Switch "lrzsz"
    Install_Switch "unzip"
    Install_Switch "p7zip"
    Install_Switch "jq"
    Install_Switch "openssl"
    Install_Switch "unhide"
    Install_Switch "net-tools"
    Install_Switch "dos2unix"

}

# ===================== 安装开发环境依赖 =====================
Dev_Base_Install(){

    if test -e /tmp/f8x_Dev_Base.txt
    then
        Echo_ALERT "检测到依赖安装记录,跳过此步骤"
    else
        echo -e "\033[1;33m\n>> 正在安装开发环境依赖\n\033[0m"

        Rm_Lock
        Install_Switch "yara"
        Install_Switch "tree"
        Install_Switch "tcpdump"
        case $Linux_Version in
            *"CentOS"*|*"RedHat"*|*"Fedora"*)
                yum groupinstall -y "Development Tools" 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 Development Tools" || Echo_ERROR "安装 Development Tools 失败,请查看日志 /tmp/f8x_error.log"
                ;;
            *"Kali"*|*"Ubuntu"*|*"Debian"*)
                Install_Switch "software-properties-common"
                Install_Switch "build-essential"
                Install_Switch "xfonts-intl-chinese"
                Install_Switch "ttf-wqy-microhei"
                Install_Switch "ttf-wqy-zenhei"
                Install_Switch "xfonts-wqy"
                Install_Switch "nethogs"
                ;;
            *)
                ;;
        esac

        touch /tmp/f8x_Dev_Base.txt 1> /dev/null 2>> /tmp/f8x_error.log
    fi

}

# ===================== 安装 Python 和 pip =====================
Python3_Install(){

    Rm_Lock
    Install_Switch "python3"
    case $Linux_Version in
        *"CentOS"*|*"RedHat"*|*"Fedora"*)
            Install_Switch "python3-devel"
            Install_Switch "python3-pip"
            python3 -m pip install --upgrade pip 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已更新 python3-pip" || Echo_ERROR "更新 python3-pip 失败,请查看日志 /tmp/f8x_error.log"

            Install_Switch4 "setuptools"
            Install_Switch4 "virtualenv"
            ;;
        *"Kali"*|*"Ubuntu"*|*"Debian"*)
            apt-get update > /dev/null 2>&1
            Install_Switch "python3-dev"
            Install_Switch "python3-pip"
            Install_Switch "python3-venv"
            python3 -m pip install --upgrade pip 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已更新 python3-pip" || Echo_ERROR "更新 python3-pip 失败,请查看日志 /tmp/f8x_error.log"
            ;;
        *)
            ;;
    esac

}

# ===================== 安装 Go =====================
Go_Install(){

    name="go"
    go version 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已存在"
    else
        Echo_ALERT "正在下载 Go 安装包(120M),该步骤可能运行较长时间,请耐心等待" && $Porxy_OK wget -O $T_Dir/$Go_Bin ${GitPorxy2}https://golang.org/dl/$Go_Bin > /dev/null 2>&1 && tar -C /usr/local -xzf $T_Dir/$Go_Bin && Echo_INFOR "已从 golang.org 下载完安装包" || Echo_ERROR "下载 Go 安装包失败! 请检查 proxychains4 配置的代理服务器是否可用"

        case $Linux_Version in
            *"CentOS"*|*"RedHat"*|*"Fedora"*)
                #export PATH=\$PATH:/usr/local/go/bin
                #export GOROOT=/usr/local/go
                #export GOPATH=\$HOME/Applications/Go

                echo "PATH=\$PATH:/usr/local/go/bin" >> /etc/bashrc
                echo "GOROOT=/usr/local/go" >> /etc/bashrc && Echo_INFOR "GOROOT : /usr/local/go"
                echo "GOPATH=\$HOME/Applications/Go" >> /etc/bashrc && Echo_INFOR "GOPATH : \$HOME/Applications/Go"
                ;;
            *"Kali"*|*"Ubuntu"*|*"Debian"*)
                #export PATH=\$PATH:/usr/local/go/bin
                #export GOROOT=/usr/local/go
                #export GOPATH=\$HOME/Applications/Go

                echo "PATH=\$PATH:/usr/local/go/bin" >> /etc/bash.bashrc
                echo "GOROOT=/usr/local/go" >> /etc/bash.bashrc && Echo_INFOR "GOROOT : /usr/local/go"
                echo "GOPATH=\$HOME/Applications/Go" >> /etc/bash.bashrc && Echo_INFOR "GOPATH : \$HOME/Applications/Go"
                ;;
            *) ;;
        esac

        ln -s /usr/local/go/bin/go /usr/bin/go 1> /dev/null 2>> /tmp/f8x_error.log
        Echo_INFOR "$(go version)" || Echo_ERROR "Golang 安装失败,请查看日志 /tmp/f8x_error.log"
        rm -f ${T_Dir:?}/${Go_Bin} > /dev/null 2>&1
    fi

}

# ===================== 安装 Docker =====================
Docker_Install(){

    name="Docker"
    docker -v 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 环境已存在"
    else
        Rm_Lock
        case $Linux_Version in
            *"Fedora"*)
                Install_Switch "device-mapper-persistent-data"
                Install_Switch "lvm2"

                Echo_ALERT "正在安装 docker,该步骤可能运行较长时间,请耐心等待" && $Porxy_OK yum install -y docker 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 docker" || Echo_ERROR "安装 docker 失败! 请检查 proxychains4 配置的代理服务器是否可用"
                ;;
            *"CentOS"*|*"RedHat"*)
                Install_Switch "device-mapper-persistent-data"
                Install_Switch "lvm2"

                $Porxy_OK curl -o /etc/yum.repos.d/docker-ce.repo https://download.docker.com/linux/centos/docker-ce.repo 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已从 docker.com 下载完 docker yum 源" || Echo_ERROR "下载 docker yum 源失败,请查看日志 /tmp/f8x_error.log"

                $Porxy_OK yum makecache 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "yum Docker 源更新失败! 请检查 proxychains4 配置的代理服务器是否可用"
                Rm_Lock
                Echo_ALERT "正在安装 docker,该步骤可能运行较长时间,请耐心等待" && $Porxy_OK yum install -y docker 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 docker" || Echo_ERROR "安装 docker 失败! 请检查 proxychains4 配置的代理服务器是否可用"
                ;;
            *"Kali"*|*"Ubuntu"*|*"Debian"*)
                Echo_INFOR "正在卸载原有 Docker 环境"
                apt-get remove -y docker 1> /dev/null 2>> /tmp/f8x_error.log
                apt-get remove -y docker-engine 1> /dev/null 2>> /tmp/f8x_error.log
                apt-get remove -y docker.io 1> /dev/null 2>> /tmp/f8x_error.log
                Rm_Lock
                apt-get update 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "更新 apt 软件包列表失败,请查看日志 /tmp/f8x_error.log"
                Install_Switch "apt-transport-https"
                Install_Switch "ca-certificates"
                Install_Switch "curl"
                Install_Switch "software-properties-common"
                Install_Switch "gnupg"
                $Porxy_OK curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -

                case $Linux_Version in
                    *"Kali"*|*"Debian"*)
                        echo -e 'deb https://download.docker.com/linux/debian' "$Linux_Version_Name" 'stable'> /etc/apt/sources.list.d/docker.list
                        ;;
                    *"Ubuntu"*)
                        echo -e 'deb https://download.docker.com/linux/ubuntu/' "$Linux_Version_Name" 'stable'> /etc/apt/sources.list.d/docker.list
                        ;;
                esac

                Echo_INFOR "正在更新 apt 软件包列表" && apt-get update 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "更新 apt 软件包列表失败,请查看日志 /tmp/f8x_error.log"

                Echo_ALERT "正在安装 docker,该步骤可能运行较长时间,请耐心等待" && $Porxy_OK apt-get install -y docker-ce 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 docker-ce" || Echo_ERROR "安装 docker-ce 失败! 请检查 proxychains4 配置的代理服务器是否可用"
                rm -f /etc/apt/sources.list.d/docker.list > /dev/null 2>&1
                ;;
            *)
                ;;
        esac

        systemctl start docker 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "docker 服务已启动" || Echo_ERROR "docker 服务启动失败,请查看日志 /tmp/f8x_error.log"
        systemctl enable docker 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "docker 服务已配置开机自启" || Echo_ERROR "docker 服务已配置开机自启失败,请查看日志 /tmp/f8x_error.log"
    fi

    docker-compose -version 1> /dev/null 2>> /tmp/f8x_error.log
    if [ $? == 0 ]
    then
        Echo_ALERT "docker-compose 已安装"
    else
        pip3_Check
        Install_Switch4 "docker-compose"
    fi

    lazydocker -version 1> /dev/null 2>> /tmp/f8x_error.log
    if [ $? == 0 ]
    then
        Echo_ALERT "lazydocker 已安装"
    else
        ( cd /tmp && $Porxy_OK wget -O install_update_linux.sh https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh > /dev/null 2>&1 && $Porxy_OK bash install_update_linux.sh > /dev/null 2>&1 ) && Echo_INFOR "已安装 lazydocker,输入 lazydocker 即可使用" || Echo_ERROR "安装 lazydocker 失败"
    fi

}

# ===================== 安装 SDKMAN =====================
SDKMAN_Install(){

    name="SDKMAN"
    sdk version 1> /dev/null 2>> /tmp/f8x_error.log
    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        cd /tmp && $Porxy_OK curl -o sdkman.sh "https://get.sdkman.io" > /dev/null 2>&1 && $Porxy_OK bash sdkman.sh > /dev/null 2>&1
        source "/root/.sdkman/bin/sdkman-init.sh"
        sdk version && Echo_INFOR "已安装 $name" || Echo_ERROR "安装 $name 失败"
    fi

}

# ===================== 安装 Terraform =====================
Terraform_Install(){

    if test -e /usr/local/bin/terraform
    then
        Echo_ALERT "terraform 已存在,若非管理员安装,建议追踪 /usr/local/bin/terraform 文件 "
    else
        Echo_ALERT "正在下载 terraform 安装包"
        cd /tmp && $Porxy_OK wget https://releases.hashicorp.com/terraform/$Terraform_Ver/$Terraform_bin > /dev/null 2>&1 && Echo_INFOR "已从 hashicorp.com 下载完安装包" || Echo_ERROR "下载 Terraform 安装包失败! 请检查 proxychains4 配置的代理服务器是否可用"
        unzip $Terraform_bin > /dev/null 2>&1
        mv terraform /usr/local/bin/terraform > /dev/null 2>&1 && Echo_INFOR "已安装 terraform $Terraform_Ver ,输入 terraform 即可使用" || Echo_ERROR "Terraform 安装失败"
    fi

}

# ===================== 安装 Serverless_Framework =====================
Serverless_Framework_Install(){

    name="Serverless Framework"
    serverless -v 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        npm config set prefix /usr/local
        $Porxy_OK npm install -g serverless
        serverless -v && Echo_INFOR "已安装 $name" || Echo_ERROR "安装 $name 失败"
    fi

}

# ===================== 安装 wrangler =====================
wrangler_Install(){

    name="wrangler"
    wrangler -V 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        $Porxy_OK cargo install wrangler
        wrangler -V && Echo_INFOR "已安装 $name" || Echo_ERROR "安装 $name 失败"
    fi

}

# ===================== 安装 SSH =====================
SSH_Tools(){

    case $Linux_Version in
        *"CentOS"*|*"RedHat"*|*"Fedora"*)
            Echo_INFOR "RedHat 系默认可用,本项 Pass"
            ;;
        *"Kali"*|*"Ubuntu"*|*"Debian"*)
            Rm_Lock
            Install_Switch "ssh"
            echo "PermitRootLogin yes" >> /etc/ssh/sshd_config && echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
            yes|ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key 1> /dev/null 2>> /tmp/f8x_error.log
            yes|ssh-keygen -t dsa -f /etc/ssh/ssh_host_rsa_key 1> /dev/null 2>> /tmp/f8x_error.log
            systemctl start ssh 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "SSH 已初始化完成" || Echo_ERROR "SSH 初始化失败,请查看日志 /tmp/f8x_error.log"
            systemctl enable ssh 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "SSH 已配置开机自启" || Echo_ERROR "SSH 配置开机自启失败,请查看日志 /tmp/f8x_error.log"
            ;;
        *) ;;
    esac

}

# ===================== 渗透目录检测 =====================
Pentest_Base_Install(){

    if test -d $P_Dir
    then
        Echo_ALERT "$P_Dir 文件夹已存在"
    else
        mkdir -p $P_Dir && Echo_INFOR "已新建 $P_Dir 文件夹"
    fi

}

# ===================== AboutSecurity =====================
Pentest_Dic_Install(){

    name="AboutSecurity"

    if test -d $P_Dir/$name
    then
        Echo_ALERT "$name 字典库已存在"
    else
        rm -rf $P_Dir/$name > /dev/null 2>&1 && $Porxy_OK git clone ${GitPorxy}https://github.com/ffffffff0x/AboutSecurity.git $P_Dir/$name > /dev/null 2>&1 && Echo_INFOR "已下载 $name 字典库在 $P_Dir/$name" || Echo_ERROR "从 github 下载 $name 字典库失败"
    fi

}

# ===================== 安装渗透杂项工具 =====================
Pentest_Misc_Install(){

    if test -e /tmp/f8x_misc.txt
    then
        Echo_ALERT "检测到工具安装记录,跳过此步骤"
    else
        Rm_Lock
        Install_Switch "parallel"
        Install_Switch "gdb"
        Install_Switch "rlwrap"
        case $Linux_Version in
            *"Kali"*|*"Ubuntu"*|*"Debian"*)
                Install_Switch "foremost"
                Install_Switch "btscanner"
                Install_Switch "rarcrack"
                Install_Switch "xdot"
                ;;
            *) ;;
        esac

        case $Linux_Version in
            *"Kali"*)
                Install_Switch "owasp-mantra-ff"
                Install_Switch "powershell"

                if [ $GitPorxy ==  ] 2>> /tmp/f8x_error.log
                then
                    $Porxy_OK gem install zsteg 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 zsteg" || Echo_ERROR "调用 gem 安装 zsteg 失败! 请运行 -ruby 选项安装 Ruby 环境"
                fi

                ;;
            *) ;;
        esac

        touch /tmp/f8x_misc.txt 1> /dev/null 2>> /tmp/f8x_error.log
    fi

}

# ===================== 安装渗透 pip 模块 =====================
Pentest_pip_Install(){

    if test -e /tmp/f8x_pip.txt
    then
        Echo_ALERT "检测到 pip 模块记录,跳过此步骤"
    else
        python3 -m pip install --upgrade pip 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已更新 python3-pip" || Echo_ERROR "更新 python3-pip 失败,请查看日志 /tmp/f8x_error.log"
        Install_Switch4 "PyJWT"
        Install_Switch4 "pyshark"
        Install_Switch4 "requests"
        Install_Switch4 "sqlparse"
        Install_Switch4 "threadpool"
        Install_Switch4 "urllib3"
        Install_Switch4 "lxml"
        Install_Switch4 "pyzbar"
        Install_Switch4 "bs4"
        Install_Switch4 "ftfy"
        Install_Switch4 "updog"
        Install_Switch4 "pefile"
        Install_Switch3 "yara"
        Install_Switch3 "pycrypto"
        Install_Switch3 "openpyxl"
        Install_Switch3 "ujson"
        Install_Switch3 "Crypto"
        Install_Switch3 "pycryptodome"
        Install_Switch3 "pytz"
        Install_Switch3 "Pillow"
        Install_Switch3 "pefile"
        touch /tmp/f8x_pip.txt 1> /dev/null 2>> /tmp/f8x_error.log
    fi

}

# ===================== 安装 hashcat、7z2hashcat =====================
Pentest_hashcat_Install(){

    dir="$P_Dir/hashcat-6.1.1"

    if test -d $dir
    then
        Echo_ALERT "hashcat 已下载在 $dir"
    else
        name="hashcat"
        $Porxy_OK wget -O $P_Dir/hashcat-6.1.1.7z ${GitPorxy2}https://hashcat.net/files/hashcat-6.1.1.7z --no-check-certificate > /dev/null 2>&1 && Echo_INFOR "已下载 hashcat-6.1.1" || Echo_ERROR2
        7za x $P_Dir/hashcat-6.1.1.7z -o$P_Dir 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "解压 $P_Dir/hashcat-6.1.1.7z 失败!\n\033[0m"
        rm -f $P_Dir/hashcat-6.1.1.7z > /dev/null 2>&1
        cd $P_Dir/hashcat* 1> /dev/null 2>> /tmp/f8x_error.log && chmod +x hashcat.bin && cp hashcat.bin hashcat
        ln -s /pentest/hashcat-6.1.1/hashcat /usr/sbin/hashcat 1> /dev/null 2>> /tmp/f8x_error.log
        hashcat --help 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 hashcat 在 $dir 目录下,直接输入 hashcat 即可使用" || Echo_ERROR "hashcat 安装失败,请查看日志 /tmp/f8x_error.log"
    fi

    if test -e $P_Dir/7z2hashcat.pl
    then
        Echo_ALERT "7z2hashcat 已下载在 $P_Dir"
    else
        name="7z2hashcat"
        $Porxy_OK curl -o $P_Dir/7z2hashcat.pl ${GitPorxy}https://raw.githubusercontent.com/philsmd/7z2hashcat/master/7z2hashcat.pl > /dev/null 2>&1 && Echo_INFOR "已下载 7z2hashcat.pl 在 $P_Dir 目录下 " || Echo_ERROR2

    fi

}

# ===================== 安装 nmap =====================
Pentest_nmap_Install(){

    name="nmap"

    nmap -V 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        Rm_Lock
        Install_Switch "nmap"
    fi

}

# ===================== 安装 ncat =====================
Pentest_ncat_Install(){

    name="ncat"

    case $Linux_Version in
        *"CentOS"*|*"RedHat"*|*"Fedora"*)
            Echo_INFOR "在安装 nmap 时已安装好 $name"
            ;;
        *"Kali"*|*"Ubuntu"*|*"Debian"*)
            ncat --version 1> /dev/null 2>> /tmp/f8x_error.log

            if [ $? == 0 ]
            then
                Echo_ALERT "$name 已安装"
            else
                Rm_Lock
                Install_Switch "ncat"
                Echo_INFOR "到这一步若长时间无反应,请手动按一下回车"
                update-alternatives --set nc /usr/bin/ncat >/dev/null 2>&1 && Echo_INFOR "已配置默认 nc 为 /usr/bin/ncat" || Echo_ERROR "设置默认 nc 为 /usr/bin/ncat 失败,请查看日志 /tmp/f8x_error.log"
            fi

            ;;
        *) ;;
    esac

}

# ===================== 安装 ffuf =====================
Pentest_ffuf_Install(){

    name="ffuf"

    ffuf -V 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "ffuf 已安装"
    else
        cd /tmp && rm -f $ffuf_Install > /dev/null 2>&1 && $Porxy_OK wget ${GitPorxy}https://github.com/ffuf/ffuf/releases/download/$ffuf_Ver/$ffuf_Install > /dev/null 2>&1 || Echo_ERROR2
        tar -zxvf $ffuf_Install 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "解压 /tmp/$ffuf_Install 失败,请查看日志 /tmp/f8x_error.log"
        mv --force ffuf /usr/local/bin/ && chmod +x /usr/local/bin/ffuf && rm -f /tmp/$ffuf_Install > /dev/null 2>&1
        ffuf -V 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 ffuf $ffuf_Ver 在 /usr/local/bin/ 目录下,直接输入 ffuf 即可使用" || Echo_ERROR3
    fi

}

# ===================== 安装 JSFinder =====================
Pentest_JSFinder_Install(){

    name="JSFinder"
    dir="$P_Dir/JSFinder"

    if test -d $dir
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        $Porxy_OK git clone ${GitPorxy}https://github.com/Threezh1/JSFinder.git $dir > /dev/null 2>&1 && cd $dir || Echo_ERROR2
        python3 JSFinder.py -h 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $name 在 $dir 目录下" || Echo_ERROR3
    fi

}

# ===================== 安装 SecretFinder =====================
Pentest_SecretFinder_Install(){

    name="SecretFinder"
    dir="$P_Dir/SecretFinder"

    if test -d $dir
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        $Porxy_OK git clone ${GitPorxy}https://github.com/m4ll0k/SecretFinder.git $dir > /dev/null 2>&1 && cd $dir || Echo_ERROR2
        pip3 install -r requirements.txt 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装依赖模块" || ( Echo_ERROR "安装依赖模块失败,请查看日志 /tmp/f8x_error.log" && rm -rf $P_Dir/SecretFinder > /dev/null 2>&1 )
        python3 SecretFinder.py -h 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $name 在 $dir 目录下" || Echo_ERROR3
    fi

}

# ===================== 安装 WebAliveScan =====================
Pentest_WebAliveScan_Install(){

    name="WebAliveScan"
    dir="$P_Dir/WebAliveScan"

    if test -d $dir
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        $Porxy_OK git clone ${GitPorxy}https://github.com/broken5/WebAliveScan.git $dir > /dev/null 2>&1 && cd $dir || Echo_ERROR2
        pip3 install -r requirements.txt > /dev/null 2>&1 && Echo_INFOR "已安装依赖模块" || ( Echo_ERROR "安装依赖模块失败,请查看日志 /tmp/f8x_error.log" && rm -rf $P_Dir/WebAliveScan )
        Install_Switch4 "gevent"
        python3 webscan.py --help > /dev/null 2>&1 && Echo_INFOR "已安装 $name 在 $P_Dir/WebAliveScan 目录下" || Echo_ERROR "$name 安装失败"
    fi

}

# ===================== 安装 OneForAll =====================
Pentest_OneForAll_Install(){

    name="OneForAll"
    dir="$P_Dir/OneForAll"

    if test -d $dir
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        Install_Switch5 "setuptools"
        Install_Switch5 "wheel"
        $Porxy_OK git clone ${GitPorxy}https://github.com/shmilylty/OneForAll.git $dir > /dev/null 2>&1 && cd $dir || Echo_ERROR "$name 下载失败! 请检查 proxychains4 配置的代理服务器是否可用,或使用 gitee 下载 git clone https://gitee.com/shmilylty/OneForAll.git "
        Echo_ALERT "正在安装依赖模块,该步骤可能运行较长时间,请耐心等待\033[0m" && pip3 install -r requirements.txt 1> /dev/null 2>> /tmp/f8x_error.log || ( Echo_ERROR "安装其他依赖模块失败,请查看日志 /tmp/f8x_error.log" && rm -rf $P_Dir/OneForAll > /dev/null 2>&1 )
        python3 oneforall.py version 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $name 在 $P_Dir/OneForAll 目录下" || Echo_ERROR3
    fi

}

# ===================== 安装 ksubdomain =====================
Pentest_ksubdomain_Install(){

    name="ksubdomain"

    ksubdomain > /dev/null 2>&1

    if [ $? == 0 ]
    then
        Echo_ALERT "ksubdomain 已安装"
    else
        Rm_Lock
        case $Linux_Version in
            *"CentOS"*|*"RedHat"*|*"Fedora"*)
                Install_Switch "libpcap"
                Install_Switch "libpcap-devel"
                ;;
            *"Kali"*|*"Ubuntu"*|*"Debian"*)
                Install_Switch "libpcap-dev"
                ;;
            *) ;;
        esac

        cd $T_Dir && rm -f $ksubdomain_Install > /dev/null 2>&1 && rm -rf ksubdomain > /dev/null 2>&1 && $Porxy_OK wget ${GitPorxy}https://github.com/knownsec/ksubdomain/releases/download/$ksubdomain_Ver/$ksubdomain_Install > /dev/null 2>&1 || Echo_ERROR2
        unzip $ksubdomain_Install 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "解压 $T_Dir/$ksubdomain_Install 失败,请查看日志 /tmp/f8x_error.log"
        mv --force ksubdomain /usr/local/bin/ && chmod +x /usr/local/bin/ksubdomain && rm -f ${T_Dir:?}/${ksubdomain_Install} > /dev/null 2>&1

        case $Linux_Version in
            *"CentOS"*|*"RedHat"*|*"Fedora"*)
                    if test -e /usr/lib64/libpcap.so.0.8
                    then
                        Echo_INFOR "libpcap.so.0.8 文件已存在"
                    else
                        cd /usr/lib64/ && ln -s libpcap.so.1 libpcap.so.0.8 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已配置 libpcap.so.0.8"
                    fi
                ;;
            *) ;;
        esac

        ksubdomain > /dev/null 2>&1 && Echo_INFOR "已安装 ksubdomain $ksubdomain_Ver 在 /usr/local/bin/ 目录下,直接输入 ksubdomain 即可使用" || Echo_ERROR3
    fi

}

# ===================== 安装 Impacket =====================
Pentest_Impacket_Install(){

    name="Impacket"
    dir="$P_Dir/impacket"

    if test -d $dir
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        $Porxy_OK git clone ${GitPorxy}https://github.com/SecureAuthCorp/impacket.git $dir > /dev/null 2>&1 || Echo_ERROR2
        cd $dir && pip3 install . > /dev/null 2>&1
        python3 setup.py install 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $name 在 $dir 目录下" || Echo_ERROR "安装 $name 失败,请查看日志 /tmp/f8x_error.log"
    fi

}

# ===================== 部署 CobaltStrike 环境 =====================
Pentest_CobaltStrike_Install(){

    name="CobaltStrike"

    Echo_ALERT "正在检测 jdk 环境可用性"
    java -version > /dev/null 2>&1

    if [ $? == 0 ]
    then
        Echo_INFOR "jdk 环境正常"
    else
        Echo_ALERT "未检测到 jdk 环境,正在自动安装 oracle-jdk"
        Oraclejdk_Install
    fi

    if test -d $P_Dir/$CS_Version
    then
        Echo_ALERT "$CS_Version 已部署在 $P_Dir/$CS_Version"
    else
        cd $P_Dir && rm -f $CS_File > /dev/null 2>&1 && $Porxy_OK wget -O $CS_File ${GitPorxy2}https://raw.githubusercontent.com/No-Github/Archive/master/CS/$CS_File > /dev/null 2>&1 || Echo_ERROR "$CS_File 下载失败! 请检查 proxychains4 配置的代理服务器是否可用"
        rm -rf $CS_Version > /dev/null 2>&1 && unzip $CS_File 1> /dev/null 2>> /tmp/f8x_error.log && rm -f $CS_File > /dev/null 2>&1
        cd $P_Dir/$CS_Version && chmod +x teamserver 1> /dev/null 2>> /tmp/f8x_error.log
        rm -f cobaltstrike.store > /dev/null 2>&1

        /usr/local/java/$jdk_Version/bin/keytool -keystore ./cobaltstrike.store -storepass 123456 -keypass 123456 -genkey -keyalg RSA -alias aliyun -dname "CN=aliyun, OU=aliyun, O=aliyun, L=aliyun, S=aliyun, C=aliyun"  1> /dev/null 2>> /tmp/f8x_error.log || keytool -keystore ./cobaltstrike.store -storepass 123456 -keypass 123456 -genkey -keyalg RSA -alias aliyun -dname "CN=aliyun, OU=aliyun, O=aliyun, L=aliyun, S=aliyun, C=aliyun"  1> /dev/null 2>> /tmp/f8x_error.log
        Echo_INFOR "已将 $CS_Version 部署在 $P_Dir/$CS_Version 目录下" || Echo_ERROR "部署 $name 环境失败,请查看日志 /tmp/f8x_error.log"
    fi

    if test -e $P_Dir/$CS_Version/genCrossC2.Linux
    then
        Echo_ALERT "genCrossC2.Linux 文件已存在 "
    else
        cd $P_Dir/$CS_Version 1> /dev/null 2>> /tmp/f8x_error.log && $Porxy_OK wget ${GitPorxy}https://github.com/gloxec/CrossC2/releases/download/$CrossC2_Ver/genCrossC2.Linux > /dev/null 2>&1 && Echo_INFOR "已下载 CrossC2 至 $P_Dir/$CS_Version/genCrossC2.Linux " || Echo_ERROR "安装 CrossC2 失败"
        chmod +x genCrossC2.Linux 1> /dev/null 2>> /tmp/f8x_error.log
    fi

    Echo_INFOR "CrossC2 命令:\n\033[0m\033[1;32mcd $P_Dir/$CS_Version/ && ./genCrossC2.Linux <IP> <port> ./.cobaltstrike.beacon_keys null Linux x64 <filename> "

    if test -e $P_Dir/$CS_Version/cobaltstrike.store
    then
        Echo_ALERT "cobaltstrike.store 文件已生成,默认 keypass 为 123456,实战中强烈建议替换!! "
    else
        Echo_ERROR "运行 keytool 失败,此步骤需要 jdk 环境,请使用 -oraclejdk 选项安装 jdk 环境,然后运行以下命令\n/usr/local/java/$jdk_Version/bin/keytool -keystore $P_Dir/$CS_Version/cobaltstrike.store -storepass 123456 -keypass 123456 -genkey -keyalg RSA -alias aliyun -dname \"CN=aliyun, OU=aliyun, O=aliyun, L=aliyun, S=aliyun, C=aliyun\"\n手动生成 cobaltstrike.store 文件!"
    fi

}

# ===================== 部署 Metasploit 框架 =====================
Pentest_Metasploit_Install(){

    name="Metasploit"

    which msfconsole 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "Metasploit 已安装"
    else
        if [ $GitPorxy ==  ]
        then
            Rm_Lock
            cd /tmp && rm -f msfinstall > /dev/null 2>&1 && $Porxy_OK curl -o msfinstall https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb 1> /dev/null 2>> /tmp/f8x_error.log && chmod 777 msfinstall
            Echo_ALERT "正在部署 Metasploit 框架,该步骤可能运行较长时间,请耐心等待" && $Porxy_OK ./msfinstall 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $name 框架,输入 msfconsole 进行体验" || Echo_ERROR "部署 $name 框架失败!"
            rm -f msfinstall > /dev/null 2>&1

        fi
    fi

}

# ===================== 安装 Sqlmap =====================
Pentest_Sqlmap_Install(){

    name="Sqlmap"
    dir="$P_Dir/sqlmap"

    if test -d $dir
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        Echo_ALERT "正在下载 Sqlmap (70M),该步骤可能运行较长时间,请耐心等待" && $Porxy_OK git clone ${GitPorxy}https://github.com/sqlmapproject/sqlmap $dir > /dev/null 2>&1 || Echo_ERROR2
        cd $dir && Echo_INFOR "已安装 Sqlmap$(python3 sqlmap.py --version) 在 $P_Dir/sqlmap 目录下" || Echo_ERROR "安装 $name 失败,请查看日志 /tmp/f8x_error.log"
    fi

}

# ===================== 安装 RustScan =====================
Pentest_RustScan_Install(){

    name="RustScan"

    rustscan -V 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "RustScan 已安装"
    else
        case $Linux_Version in
            *"CentOS"*|*"RedHat"*|*"Fedora"*)
                if [ $GitPorxy ==  ]
                then
                    rm -f /var/cache/dnf/metadata_lock.pid > /dev/null 2>&1
                    $Porxy_OK dnf install -y 'dnf-command(copr)' 1> /dev/null 2>> /tmp/f8x_error.log && $Porxy_OK dnf copr enable atim/rustscan -y 1> /dev/null 2>> /tmp/f8x_error.log && $Porxy_OK dnf install -y rustscan 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $name 工具" || Echo_ERROR "安装 $name 工具失败! 请检查是否安装 dnf!请检查 proxychains4 配置的代理服务器是否可用"
                fi
                ;;
            *"Kali"*|*"Ubuntu"*|*"Debian"*)
                cd /tmp && rm -f $RustScan_Install > /dev/null 2>&1 && $Porxy_OK wget ${GitPorxy}https://github.com/RustScan/RustScan/releases/download/$RustScan_Version/$RustScan_Install > /dev/null 2>&1 || Echo_ERROR2
                dpkg -i $RustScan_Install 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $name" || Echo_ERROR "安装 $name 失败! 在部分 debian 系列发行版上可能遇到 libc6 问题, 请自行解决"
                rm -f $RustScan_Install > /dev/null 2>&1
                ;;
            *) ;;
        esac

    fi

}

# ===================== 安装 WAFW00F =====================
Pentest_WAFW00F_Install(){

    name="WAFW00F"
    dir="$P_Dir/wafw00f"

    wafw00f -V 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "WAFW00F 已安装"
    else
        rm -rf $dir && $Porxy_OK git clone ${GitPorxy}https://github.com/EnableSecurity/wafw00f $dir > /dev/null 2>&1 || Echo_ERROR2
        cd $dir && python3 setup.py install > /dev/null 2>&1 && Echo_INFOR "已安装 $name" || Echo_ERROR "安装 $name 失败,请查看日志 /tmp/f8x_error.log"
    fi

}

# ===================== 安装 xray =====================
Pentest_xray_Install(){

    name="xray"
    dir="$P_Dir/xray"

    if test -d $dir
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        mkdir -p $dir && cd $_ && Echo_ALERT "正在下载 xray" && $Porxy_OK wget ${GitPorxy}https://github.com/chaitin/xray/releases/download/$xray_Ver/$xray_File > /dev/null 2>&1 || Echo_ERROR2
        unzip $xray_File 1> /dev/null 2>> /tmp/f8x_error.log && rm -f $xray_File > /dev/null 2>&1 && Echo_INFOR "已安装 $name $xray_Ver 在 $dir 目录下" || Echo_ERROR "安装 xray 失败,请查看日志 /tmp/f8x_error.log"
    fi

}

# ===================== 安装 masscan =====================
Pentest_masscan_Install(){

    name="masscan"

    which masscan 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        Rm_Lock
        Install_Switch "masscan"
    fi

}

# ===================== 安装 fscan =====================
Pentest_fscan_Install(){

    name="fscan"

    fscan > /dev/null 2>&1

    if [ $? == 0 ]
    then
        Echo_ALERT "fscan 已安装"
    else
        cd /tmp && rm -f $fscan_Install > /dev/null 2>&1 && $Porxy_OK wget ${GitPorxy}https://github.com/shadow1ng/fscan/releases/download/$fscan_Ver/$fscan_Install > /dev/null 2>&1 || Echo_ERROR2
        mv $fscan_Install fscan && mv --force fscan /usr/local/bin/ && chmod +x /usr/local/bin/fscan
        fscan > /dev/null 2>&1 && Echo_INFOR "已安装 $name $fscan_Ver 在 /usr/local/bin/ 目录下,直接输入 fscan 即可使用" || Echo_ERROR3
    fi

}

# ===================== 安装 pocsuite3 =====================
Pentest_pocsuite3_Install(){

    name="pocsuite3"

    pocsuite --version 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        Install_Switch4 "pocsuite3"
    fi

}

# ===================== 安装 Nuclei =====================
Pentest_Nuclei_Install(){

    name="Nuclei"

    nuclei -version > /dev/null 2>&1

    if [ $? == 0 ]
    then
        Echo_ALERT "Nuclei 已安装"
    else
        cd /tmp && rm -f $Nuclei_Install > /dev/null 2>&1 && $Porxy_OK wget ${GitPorxy}https://github.com/projectdiscovery/nuclei/releases/download/$Nuclei_Ver/$Nuclei_Install > /dev/null 2>&1 || Echo_ERROR2
        tar -zxvf $Nuclei_Install 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "解压 /tmp/$Nuclei_Install 失败,请查看日志 /tmp/f8x_error.log"
        mv --force nuclei /usr/local/bin/ && chmod +x /usr/local/bin/nuclei && rm -f /tmp/$Nuclei_Install > /dev/null 2>&1
        nuclei -version > /dev/null 2>&1 && Echo_INFOR "已安装 $name $Nuclei_Ver 在 /usr/local/bin/ 目录下,直接输入 nuclei 即可使用" || Echo_ERROR3

        if [ $GitPorxy ==  ]
        then
            echo -e "\033[1;33m\n>> 正在更新 Nuclei 扫描规则\n\033[0m"
            cd $P_Dir && $Porxy_OK nuclei -update-templates > /dev/null 2>&1 && Echo_INFOR "已更新 nuclei-templates 列表 " || Echo_ERROR "nuclei-templates 列表更新失败,请查看日志 /tmp/f8x_error.log"
        fi

    fi

}

# ===================== 安装 rad =====================
Pentest_rad_Install(){

    name="rad"

    rad -h 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        cd /tmp && rm -f $rad_File > /dev/null 2>&1 && $Porxy_OK wget ${GitPorxy}https://github.com/chaitin/rad/releases/latest/download/$rad_File > /dev/null 2>&1 || Echo_ERROR2
        unzip $rad_File 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "解压 /tmp/$rad_File 失败,请查看日志 /tmp/f8x_error.log"
        mv rad_linux_amd64 rad
        mv --force rad /usr/local/bin/ && chmod +x /usr/local/bin/rad && rm -f /tmp/$rad_File > /dev/null 2>&1 && Echo_INFOR "已安装 $name 在 /usr/local/bin/ 目录下,直接输入 rad 即可使用" || Echo_ERROR3

        Echo_INFOR "rad 需配合 chromium 使用,可使用 -chromium 选项安装 chromium"
    fi

}

# ===================== 安装 crawlergo =====================
Pentest_crawlergo_Install(){

    name="crawlergo"

    crawlergo -v 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        cd /tmp && rm -f $crawlergo_File > /dev/null 2>&1 && $Porxy_OK wget ${GitPorxy}https://github.com/0Kee-Team/crawlergo/releases/latest/download/$crawlergo_File > /dev/null 2>&1 || Echo_ERROR2
        unzip $crawlergo_File 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "解压 /tmp/$crawlergo_File 失败,请查看日志 /tmp/f8x_error.log"
        mv --force crawlergo /usr/local/bin/ && chmod +x /usr/local/bin/crawlergo && rm -f /tmp/$crawlergo_File > /dev/null 2>&1 && Echo_INFOR "已安装 $name 在 /usr/local/bin/ 目录下,直接输入 crawlergo 即可使用" || Echo_ERROR3

        Echo_INFOR "crawlergo 需配合 chromium 使用,可使用 -chromium 选项安装 chromium"
    fi

}

# ===================== 安装 w13scan =====================
Pentest_w13scan_Install(){

    name="w13scan"
    dir="$P_Dir/w13scan"

    if test -d $dir
    then
        Echo_ALERT "w13scan 已下载在 $P_Dir/w13sca"
    else
        $Porxy_OK git clone ${GitPorxy}https://github.com/w-digital-scanner/w13scan.git $dir > /dev/null 2>&1 && Echo_INFOR "已下载 w13scan" || Echo_ERROR2
        cd $dir && pip3 install -r requirements.txt > /dev/null 2>&1

        Install_Switch4 "cowpy"
        cd W13SCAN && python3 w13scan.py -h 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 w13scan 在 $P_Dir/w13scan 目录下" || Echo_ERROR "安装 w13scan 失败,请查看日志 /tmp/f8x_error.log"
    fi

}

# ===================== 安装 Responder =====================
Pentest_Responder_Install(){

    name="Responder"
    dir="$P_Dir/Responder"

    if test -d $dir
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        $Porxy_OK git clone ${GitPorxy}https://github.com/lgandx/Responder.git $dir > /dev/null 2>&1 && cd $dir || Echo_ERROR2
        python3 Responder.py -h 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $name 在 $dir 目录下" || Echo_ERROR3
    fi
}

# ===================== 安装 krbrelayx =====================
Pentest_krbrelayx_Install(){

    name="krbrelayx"
    dir="$P_Dir/krbrelayx"

    if test -d $dir
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        $Porxy_OK git clone ${GitPorxy}https://github.com/dirkjanm/krbrelayx.git $dir > /dev/null 2>&1 && Echo_INFOR "已安装 $name 在 $dir 目录下" || Echo_ERROR3
    fi

}

# ===================== 安装 Girsh =====================
Pentest_Girsh_Install(){

    name="Girsh"

    Girsh -h 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        cd /tmp && rm -f $Girsh_bin > /dev/null 2>&1 && $Porxy_OK wget ${GitPorxy}https://github.com/nodauf/Girsh/releases/download/$Girsh_Ver/$Girsh_bin > /dev/null 2>&1 || Echo_ERROR2
        tar -zxvf $Girsh_bin 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "解压 /tmp/$Girsh_bin 失败,请查看日志 /tmp/f8x_error.log"
        mv --force Girsh /usr/local/bin/ && chmod +x /usr/local/bin/Girsh && rm -f /tmp/$Girsh_bin > /dev/null 2>&1 && Echo_INFOR "已安装 $name $Girsh_Ver 在 /usr/local/bin/ 目录下,直接输入 Girsh 即可使用" || Echo_ERROR3
    fi

}

# ===================== 安装 ApkAnalyser =====================
Pentest_ApkAnalyser_Install(){

    name="ApkAnalyser"
    dir="$P_Dir/"

    if test -e $P_Dir/apkAnalyser.py
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        Install_Switch4 "apkutils"
        curl -o $P_Dir/apkAnalyser.py https://cdn.jsdelivr.net/gh/TheKingOfDuck/ApkAnalyser/apkAnalyser.py > /dev/null 2>&1 && Echo_INFOR "已安装 $name 在 $dir 目录下" || Echo_ERROR3
    fi

}

# ===================== 安装 commix =====================
Pentest_commix_Install(){

    name="commix"
    dir="$P_Dir/commix"

    if test -d $dir
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        $Porxy_OK git clone ${GitPorxy}https://github.com/commixproject/commix.git $dir > /dev/null 2>&1 && cd $dir || Echo_ERROR2
        python3 commix.py -h 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $name 在 $dir 目录下" || Echo_ERROR3
    fi

}

# ===================== 安装 exploitdb 库 =====================
Pentest_exploitdb_Install(){

    name="exploitdb"
    dir="$P_Dir/exploitdb"

    if test -d $dir
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        $Porxy_OK git clone ${GitPorxy}https://github.com/offensive-security/exploitdb.git $dir > /dev/null 2>&1 && Echo_INFOR "已安装 $name 在 $dir 目录下" || Echo_ERROR3
    fi

}

# ===================== 安装 tplmap =====================
Pentest_tplmap_Install(){

    name="tplmap"
    dir="$P_Dir/tplmap"

    if test -d $dir
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        $Porxy_OK git clone ${GitPorxy}https://github.com/epinna/tplmap.git $dir > /dev/null 2>&1 && cd $dir || Echo_ERROR2
        python2 tplmap.py -h 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $name 在 $dir 目录下" || Echo_ERROR3
    fi

}

# ===================== 安装 routersploit =====================
Pentest_routersploit_Install(){

    name="routersploit"
    dir="$P_Dir/routersploit"

    if test -d $dir
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        $Porxy_OK git clone ${GitPorxy}https://github.com/threat9/routersploit.git $dir > /dev/null 2>&1 && cd $dir || Echo_ERROR2
        Echo_ALERT "正在安装依赖模块,该步骤可能运行较长时间,请耐心等待" && pip3 install -r requirements.txt 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $name 在 $dir 目录下" || Echo_ERROR3
        case $Linux_Version in
            *"Kali"*|*"Ubuntu"*|*"Debian"*)
                Echo_ALERT "正在安装 Bluetooth Low Energy 支持"
                Rm_Lock
                Install_Switch "libglib2.0-dev"
                Install_Switch5 "bluepy"
                ;;
            *) ;;
        esac

    fi

}

# ===================== 安装 bettercap =====================
Pentest_bettercap_Install(){

    name="bettercap"

    which bettercap > /dev/null 2>&1

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        cd /tmp && rm -f $bettercap_bin > /dev/null 2>&1 && $Porxy_OK wget ${GitPorxy}https://github.com/bettercap/bettercap/releases/download/$bettercap_Ver/$bettercap_bin > /dev/null 2>&1 || Echo_ERROR2
        unzip $bettercap_bin 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "解压 /tmp/$bettercap_bin 失败,请查看日志 /tmp/f8x_error.log"
        mv --force bettercap /usr/local/bin/ && chmod +x /usr/local/bin/bettercap && rm -f /tmp/$bettercap_bin > /dev/null 2>&1 && Echo_INFOR "已安装 $name $bettercap_Ver 在 /usr/local/bin/ 目录下,直接输入 bettercap 即可使用" || Echo_ERROR3

        case $Linux_Version in
            *"Kali"*|*"Ubuntu"*|*"Debian"*)
                Rm_Lock
                Install_Switch "libnetfilter-queue-dev"
                Install_Switch "libusb-1.0-0"
                ;;
            *) ;;
        esac

    fi

}

# ===================== 安装 mitmproxy =====================
Pentest_mitmproxy_Install(){

    name="mitmproxy"

    which mitmproxy > /dev/null 2>&1

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        if [ $GitPorxy ==  ]
        then
            cd /tmp && rm -f $mitmproxy_bin > /dev/null 2>&1 && $Porxy_OK wget -O $mitmproxy_bin https://snapshots.mitmproxy.org/$mitmproxy_Ver/$mitmproxy_bin > /dev/null 2>&1 || Echo_ERROR2
            tar -zxvf $mitmproxy_bin 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "解压 /tmp/$mitmproxy_bin 失败,请查看日志 /tmp/f8x_error.log"
            mv --force mitmproxy /usr/local/bin/ && chmod +x /usr/local/bin/mitmproxy && rm -f /tmp/$mitmproxy_bin > /dev/null 2>&1 && Echo_INFOR "已安装 $name $mitmproxy_Ver 在 /usr/local/bin/ 目录下,直接输入 mitmproxy 即可使用" || Echo_ERROR3
            mv --force mitmdump /usr/local/bin/ && chmod +x /usr/local/bin/mitmdump && Echo_INFOR "已安装 mitmdump 在 /usr/local/bin/ 目录下,直接输入 mitmdump 即可使用" || Echo_ERROR "mitmdump 安装失败,请查看日志 /tmp/f8x_error.log"
            mv --force mitmweb /usr/local/bin/ && chmod +x /usr/local/bin/mitmweb && Echo_INFOR "已安装 mitmweb 在 /usr/local/bin/ 目录下,直接输入 mitmweb 即可使用" || Echo_ERROR "mitmweb 安装失败,请查看日志 /tmp/f8x_error.log"
        fi
    fi

}

# ===================== 安装 naabu =====================
Pentest_naabu_Install(){

    name="naabu"

    naabu -version > /dev/null 2>&1

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        cd /tmp && rm -f $naabu_bin > /dev/null 2>&1 && $Porxy_OK wget ${GitPorxy}https://github.com/projectdiscovery/naabu/releases/latest/download/$naabu_bin > /dev/null 2>&1 || Echo_ERROR2
        tar -zxvf $naabu_bin 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "解压 /tmp/$naabu_bin 失败,请查看日志 /tmp/f8x_error.log"
        mv --force naabu-linux-amd64 /usr/local/bin/naabu && chmod +x /usr/local/bin/naabu && rm -f /tmp/$naabu_bin > /dev/null 2>&1
        naabu -version > /dev/null 2>&1 && Echo_INFOR "已安装 $name 在 /usr/local/bin/ 目录下,直接输入 naabu 即可使用" || Echo_ERROR3
    fi

}

# ===================== 安装 proxify =====================
Pentest_proxify_Install(){

    name="proxify"

    proxify -version > /dev/null 2>&1

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        cd /tmp && rm -f $proxify_bin > /dev/null 2>&1 && $Porxy_OK wget ${GitPorxy}https://github.com/projectdiscovery/proxify/releases/download/$proxify_Ver/$proxify_bin > /dev/null 2>&1 || Echo_ERROR2
        tar -zxvf $proxify_bin 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "解压 /tmp/$proxify_bin 失败,请查看日志 /tmp/f8x_error.log"
        mv --force proxify /usr/local/bin/proxify && chmod +x /usr/local/bin/proxify && rm -f /tmp/$proxify_bin > /dev/null 2>&1
        proxify -version > /dev/null 2>&1 && Echo_INFOR "已安装 $name $proxify_Ver 在 /usr/local/bin/ 目录下,直接输入 proxify 即可使用" || Echo_ERROR3
    fi

}

# ===================== 安装 pypykatz =====================
Pentest_pypykatz_Install(){

    name="pypykatz"

    which pypykatz 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        Install_Switch4 "pypykatz"
    fi

}

# ===================== 安装 CrackMapExec =====================
Pentest_CrackMapExec_Install(){

    name="CrackMapExec"

    which crackmapexec 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        Install_Switch5 "pipx"
        pipx ensurepath
        pipx install crackmapexec
    fi

}

# ===================== 安装 httpx =====================
Pentest_httpx_Install(){

    name="httpx"

    httpx -version > /dev/null 2>&1

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        cd /tmp && rm -f $httpx_bin > /dev/null 2>&1 && $Porxy_OK wget ${GitPorxy}https://github.com/projectdiscovery/httpx/releases/download/$httpx_Ver/$httpx_bin > /dev/null 2>&1 || Echo_ERROR2
        tar -zxvf $httpx_bin 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "解压 /tmp/$httpx_bin 失败,请查看日志 /tmp/f8x_error.log"
        mv --force httpx /usr/local/bin/httpx && chmod +x /usr/local/bin/httpx && rm -f /tmp/$httpx_bin > /dev/null 2>&1
        httpx -version > /dev/null 2>&1 && Echo_INFOR "已安装 $name $httpx_Ver 在 /usr/local/bin/ 目录下,直接输入 httpx 即可使用" || Echo_ERROR3
    fi

}

# ===================== 安装 subfinder =====================
Pentest_subfinder_Install(){

    name="subfinder"

    subfinder -version > /dev/null 2>&1

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        cd /tmp && rm -f $subfinder_bin > /dev/null 2>&1 && $Porxy_OK wget ${GitPorxy}https://github.com/projectdiscovery/subfinder/releases/download/$subfinder_Ver/$subfinder_bin > /dev/null 2>&1 || Echo_ERROR2
        tar -zxvf $subfinder_bin 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "解压 /tmp/$subfinder_bin 失败,请查看日志 /tmp/f8x_error.log"
        mv --force subfinder /usr/local/bin/subfinder && chmod +x /usr/local/bin/subfinder && rm -f /tmp/$subfinder_bin > /dev/null 2>&1
        subfinder -version > /dev/null 2>&1 && Echo_INFOR "已安装 $name $subfinder_Ver 在 /usr/local/bin/ 目录下,直接输入 subfinder 即可使用" || Echo_ERROR3
    fi

}

# ===================== 安装 mapcidr =====================
Pentest_mapcidr_Install(){

    name="mapcidr"

    mapcidr -version > /dev/null 2>&1

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        cd /tmp && rm -f $mapcidr_bin > /dev/null 2>&1 && $Porxy_OK wget ${GitPorxy}https://github.com/projectdiscovery/mapcidr/releases/download/$mapcidr_Ver/$mapcidr_bin > /dev/null 2>&1 || Echo_ERROR2
        tar -zxvf $mapcidr_bin 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "解压 /tmp/$mapcidr_bin 失败,请查看日志 /tmp/f8x_error.log"
        mv --force mapcidr /usr/local/bin/mapcidr && chmod +x /usr/local/bin/mapcidr && rm -f /tmp/$mapcidr_bin > /dev/null 2>&1
        mapcidr -version > /dev/null 2>&1 && Echo_INFOR "已安装 $name $mapcidr_Ver 在 /usr/local/bin/ 目录下,直接输入 mapcidr 即可使用" || Echo_ERROR3
    fi

}

# ===================== 安装 apktool =====================
Pentest_apktool_Install(){

    name="apktool"

    apktool -version > /dev/null 2>&1

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        cd /tmp && rm -f apktool > /dev/null 2>&1 && $Porxy_OK wget -O apktool ${GitPorxy}https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool > /dev/null 2>&1 || Echo_ERROR2
        rm -f $apktool_bin > /dev/null 2>&1 && $Porxy_OK wget ${GitPorxy}https://github.com/iBotPeaches/Apktool/releases/download/$apktool_Ver/$apktool_bin > /dev/null 2>&1 || Echo_ERROR2
        mv $apktool_bin apktool.jar && mv --force apktool.jar /usr/local/bin/apktool.jar && chmod +x /usr/local/bin/apktool.jar
        mv --force apktool /usr/local/bin/apktool && chmod +x /usr/local/bin/apktool
        apktool -version > /dev/null 2>&1 && Echo_INFOR "已安装 $name $apktool_Ver 在 /usr/local/bin/ 目录下,直接输入 apktool 即可使用" || Echo_ERROR3
    fi

}

# ===================== 安装 OpenRedireX =====================
Pentest_OpenRedireX_Install(){

    name="OpenRedireX"
    dir="$P_Dir/OpenRedireX"

    if test -d $dir
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        Install_Switch4 "aiohttp"
        cd $P_Dir && $Porxy_OK git clone ${GitPorxy}https://github.com/No-Github/OpenRedireX.git > /dev/null 2>&1 && cd $dir || Echo_ERROR2
        python3 openredirex.py -h 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $name 在 $dir 目录下" || Echo_ERROR3
    fi

}

# ===================== 安装 gau =====================
Pentest_gau_Install(){

    name="gau"

    gau -version > /dev/null 2>&1

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        cd /tmp && rm -f $gau_bin > /dev/null 2>&1 && $Porxy_OK wget ${GitPorxy}https://github.com/lc/gau/releases/download/$gau_Ver/$gau_bin > /dev/null 2>&1 || Echo_ERROR2
        tar -zxvf $gau_bin 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "解压 /tmp/$gau_bin 失败,请查看日志 /tmp/f8x_error.log"
        mv --force gau /usr/local/bin/gau && chmod +x /usr/local/bin/gau && rm -f /tmp/$gau_bin > /dev/null 2>&1
        gau -version > /dev/null 2>&1 && Echo_INFOR "已安装 $name $gau_Ver 在 /usr/local/bin/ 目录下,直接输入 gau 即可使用" || Echo_ERROR3
    fi

}

# ===================== 安装 apkleaks =====================
Pentest_apkleaks_Install(){

    name="apkleaks"
    apkleaks -h > /dev/null 2>&1

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        Install_Switch4 "apkleaks"
    fi

}

# ===================== 安装 jadx =====================
Pentest_jadx_Install(){

    name="jadx"
    jadx --version > /dev/null 2>&1

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        mkdir -p /usr/local/jadx && cd /usr/local/jadx && rm -f $jadx_bin > /dev/null 2>&1 && $Porxy_OK wget ${GitPorxy}https://github.com/skylot/jadx/releases/download/$jadx_Ver/$jadx_bin > /dev/null 2>&1 || Echo_ERROR2
        unzip $jadx_bin 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "解压 /usr/local/$jadx_bin 失败,请查看日志 /tmp/f8x_error.log"
        chmod +x /usr/local/jadx/bin/jadx && ln -s /usr/local/jadx/bin/jadx /usr/local/bin/jadx && rm -f /usr/local/$jadx_bin > /dev/null 2>&1
        jadx --version > /dev/null 2>&1 && Echo_INFOR "已安装 $name $jadx_Ver 在 /usr/local/jadx/ 目录下,直接输入 jadx 即可使用" || Echo_ERROR3

    fi

}

# ===================== 安装 Diggy =====================
Pentest_Diggy_Install(){

    name="Diggy"
    dir="$P_Dir/"

    if test -e $P_Dir/diggy.sh
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        cd $P_Dir && curl -o diggy.sh https://cdn.jsdelivr.net/gh/s0md3v/Diggy/diggy.sh > /dev/null 2>&1 && Echo_INFOR "已安装 $name 在 $dir 目录下" || Echo_ERROR3
    fi

}

# ===================== 安装 CORScanner =====================
Pentest_CORScanner_Install(){

    name="CORScanner"
    dir="$P_Dir/CORScanner"

    if test -d $dir
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        $Porxy_OK git clone ${GitPorxy}https://github.com/chenjj/CORScanner.git $dir > /dev/null 2>&1 && Echo_INFOR "已下载 $name" || Echo_ERROR2
        cd $dir && pip3 install -r requirements.txt > /dev/null 2>&1
        python3 cors_scan.py -h 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $name 在 $dir 目录下" || Echo_ERROR3
    fi

}

# ===================== 安装 swagger-exp =====================
Pentest_swagger-exp_Install(){

    name="swagger-exp"
    dir="$P_Dir/swagger-exp"

    if test -d $dir
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        $Porxy_OK git clone ${GitPorxy}https://github.com/lijiejie/swagger-exp.git $dir > /dev/null 2>&1 && Echo_INFOR "已下载 $name" || Echo_ERROR2
        cd $dir && Echo_INFOR "已安装 $name 在 $dir 目录下" || Echo_ERROR3
    fi

}

# ===================== 安装 swagger-hack =====================
Pentest_swagger-hack_Install(){

    name="swagger-hack"
    dir="$P_Dir/swagger-hack"

    if test -d $dir
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        $Porxy_OK git clone ${GitPorxy}https://github.com/jayus0821/swagger-hack.git $dir > /dev/null 2>&1 && Echo_INFOR "已下载 $name" || Echo_ERROR2
        cd $dir && python3 swagger-hack2.0.py -h > /dev/null 2>&1 && Echo_INFOR "已安装 $name 在 $dir 目录下" || Echo_ERROR3
    fi

}

# ===================== 安装 shiro-exploit =====================
Pentest_shiro-exploit_Install(){

    name="shiro-exploit"
    dir="$P_Dir/shiro-exploit"

    if test -d $dir
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        $Porxy_OK git clone ${GitPorxy}https://github.com/Ares-X/shiro-exploit.git $dir > /dev/null 2>&1 && Echo_INFOR "已下载 $name" || Echo_ERROR2
        Install_Switch4 "pycryptodome"
        cd $dir && python3 shiro-exploit.py -h > /dev/null 2>&1 && Echo_INFOR "已安装 $name 在 $dir 目录下" || Echo_ERROR3
    fi

}

# ===================== 安装 ysoserial =====================
Pentest_ysoserial_Install(){

    name="ysoserial"
    dir="$P_Dir/ysoserial"

    if test -e $dir/ysoserial.jar
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        mkdir -p $dir && cd $_ && rm -f ysoserial.jar > /dev/null 2>&1 && $Porxy_OK wget -O ysoserial.jar ${GitPorxy2}https://jitpack.io/com/github/frohoff/ysoserial/master-SNAPSHOT/ysoserial-master-SNAPSHOT.jar > /dev/null 2>&1 || Echo_ERROR2
        if test -e $dir/ysoserial.jar
        then
            Echo_INFOR "已安装 $name 在 $dir 目录下"
        else
            Echo_ERROR3
        fi
    fi

}

# ===================== 安装 remote-method-guesser =====================
Pentest_remote-method-guesser_Install(){

    name="remote-method-guesser"
    dir="$P_Dir/remote-method-guesser"

    if test -e $dir/rmg.jar
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        mkdir -p $dir && cd $_ && rm -f rmg.jar > /dev/null 2>&1 && $Porxy_OK wget -O rmg.jar ${GitPorxy}https://github.com/qtc-de/remote-method-guesser/releases/download/$rmg_Ver/$rmg_bin > /dev/null 2>&1 || Echo_ERROR2
        java -jar rmg.jar --help > /dev/null 2>&1 && Echo_INFOR "已安装 $name 在 $dir 目录下" || Echo_ERROR3
    fi

}

# ===================== 安装 SSRFmap =====================
Pentest_SSRFmap_Install(){

    name="SSRFmap"
    dir="$P_Dir/SSRFmap"

    if test -d $dir
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        $Porxy_OK git clone ${GitPorxy}https://github.com/swisskyrepo/SSRFmap.git $dir > /dev/null 2>&1 && Echo_INFOR "已下载 $name" || Echo_ERROR2
        cd $dir && pip3 install -r requirements.txt > /dev/null 2>&1 && python3 ssrfmap.py -h > /dev/null 2>&1 && Echo_INFOR "已安装 $name 在 $dir 目录下" || Echo_ERROR3
    fi

}

# ===================== 安装 See-SURF =====================
Pentest_See-SURF_Install(){

    name="See-SURF"
    dir="$P_Dir/See-SURF"

    if test -d $dir
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        $Porxy_OK git clone ${GitPorxy}https://github.com/In3tinct/See-SURF.git $dir > /dev/null 2>&1 && Echo_INFOR "已下载 $name" || Echo_ERROR2
        cd $dir && python3 see-surf.py -h > /dev/null 2>&1 && Echo_INFOR "已安装 $name 在 $dir 目录下" || Echo_ERROR3
    fi

}

# ===================== 安装 testssl =====================
Pentest_testssl_Install(){

    name="testssl"
    dir="$P_Dir/"

    if test -e $P_Dir/testssl.sh
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        cd $P_Dir && curl -o testssl.sh https://cdn.jsdelivr.net/gh/drwetter/testssl.sh/testssl.sh > /dev/null 2>&1 && Echo_INFOR "已安装 $name 在 $dir 目录下" || Echo_ERROR3
    fi

}

# ===================== 安装 MassBleed =====================
Pentest_MassBleed_Install(){

    name="MassBleed"
    dir="$P_Dir/MassBleed"

    if test -d $dir
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        $Porxy_OK git clone ${GitPorxy}https://github.com/1N3/MassBleed.git $dir > /dev/null 2>&1 && Echo_INFOR "已下载 $name 在 $dir 目录下" || Echo_ERROR2
    fi

}

# ===================== 安装 unyaffs =====================
unyaffs_Install(){

    name="unyaffs"

    cd $T_Dir && rm -f unyaffs > /dev/null 2>&1 && $Porxy_OK wget -O unyaffs ${GitPorxy2}https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/unyaffs/unyaffs > /dev/null 2>&1 || Echo_ERROR2
    mv --force unyaffs /usr/local/bin/ && chmod +x /usr/local/bin/unyaffs && Echo_INFOR "已安装 unyaffs 在 /usr/local/bin/ 目录下" || Echo_ERROR "unyaffs 安装失败,请查看日志 /tmp/f8x_error.log"

}

# ===================== 安装 Fail2Ban =====================
Secure_Fail2Ban_Install(){

    name="Fail2Ban"
    fail2ban-client -V 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        Rm_Lock
        Install_Switch "fail2ban"
        systemctl restart fail2ban 1> /dev/null 2>> /tmp/f8x_error.log && sleep 0.5
        echo -e "fail2ban-client ping" 1> /dev/null 2>> /tmp/f8x_error.log && sleep 1 && fail2ban-client ping
    fi

}

# ===================== 安装 chkrootkit =====================
Secure_chkrootkit_Install(){

    name="chkrootkit"

    if test -d $T_Dir/chkrootkit-*
    then
        Echo_ALERT "$name 已下载在 $T_Dir/"
    else
        cd $T_Dir && rm -f chkrootkit.tar.gz > /dev/null 2>&1 && $Porxy_OK wget ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz > /dev/null 2>&1 && Echo_INFOR "已下载 $name" || Echo_ERROR "$name 下载失败"
        tar zxvf chkrootkit.tar.gz 1> /dev/null 2>> /tmp/f8x_error.log && rm -f chkrootkit.tar.gz > /dev/null 2>&1
        cd chkrootkit-* && make sense 1> /dev/null 2>> /tmp/f8x_error.log
        Echo_INFOR "已安装 $name 在 $T_Dir 目录下" || Echo_ERROR3
    fi

}

# ===================== 安装 rkhunter =====================
Secure_rkhunter_Install(){

    name="rkhunter"
    rkhunter --version 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        Rm_Lock
        Install_Switch "rkhunter"
    fi

}

# ===================== 安装 shellpub =====================
Secure_shellpub_Install(){

    name="shellpub"

    if test -d $T_Dir/hm
    then
        Echo_ALERT "河马 webshell 查杀工具已下载在 $T_Dir/hm"
    else
        mkdir -p $T_Dir/hm && cd $_ && $Porxy_OK wget -O hm-linux.tgz http://dl.shellpub.com/hm/latest/hm-linux-amd64.tgz?version=1.8.2 > /dev/null 2>&1 && Echo_INFOR "已下载河马 webshell 查杀工具" || Echo_ERROR "河马 webshell 查杀工具下载失败"
        tar zxvf hm-linux.tgz 1> /dev/null 2>> /tmp/f8x_error.log && rm -f hm-linux.tgz > /dev/null 2>&1 && Echo_INFOR "已安装河马 webshell 查杀工具在 $T_Dir/hm 目录下" || Echo_ERROR "安装河马 webshell 查杀工具失败,请查看日志 /tmp/f8x_error.log"
    fi

}

# ===================== 安装 anti-portscan =====================
Secure_anti_portscan_Install(){

    name="anti-portscan"

    if test -d $T_Dir/anti-portscan
    then
        Echo_ALERT "anti-portscan 已下载在 $T_Dir/anti-portscan"
    else
        cd $T_Dir && rm -f anti-portscan > /dev/null 2>&1 && $Porxy_OK git clone ${GitPorxy}https://github.com/EtherDream/anti-portscan.git > /dev/null 2>&1 && Echo_INFOR "已下载 anti-portscan 在 $T_Dir/anti-portscan 目录下 (不清楚用法的情况先不要使用,不然有可能会无法连接ssh)" || Echo_ERROR2
    fi

}

# ===================== 安装 BruteShark =====================
Secure_BruteShark_Install(){

    name="BruteShark"
    dir="$T_Dir/BruteShark"

    if test -d $T_Dir/BruteShark
    then
        Echo_ALERT "$name 已下载在 $T_Dir/ "
    else
        Rm_Lock
        case $Linux_Version in
            *"CentOS"*|*"RedHat"*|*"Fedora"*)
                Install_Switch "libpcap"
                Install_Switch "libpcap-devel"
                ;;
            *"Kali"*|*"Ubuntu"*|*"Debian"*)
                Install_Switch "libpcap-dev"
                ;;
            *) ;;
        esac
        mkdir -p $T_Dir/BruteShark && cd $_ && $Porxy_OK wget ${GitPorxy}https://github.com/odedshimon/BruteShark/releases/latest/download/BruteSharkCli > /dev/null 2>&1 && chmod +x BruteSharkCli && Echo_INFOR "已下载 $name 在 $dir " || Echo_ERROR2
        find /usr/lib/x86_64-linux-gnu -type f | grep libpcap | head -1 | xargs -i sudo ln -s {} /usr/lib/x86_64-linux-gnu/libpcap.so > /dev/null 2>&1
    fi

}

# ===================== 安装 Bash_Insulter =====================
Bash_Insulter(){

    name="Bash_Insulter"

    if test -e /etc/bash.command-not-found
    then
        Echo_ALERT "Bash_Insulter 已安装在 /etc/bash.command-not-found"
    else
        rm -rf $T_Dir/bash-insulter > /dev/null 2>&1 && $Porxy_OK git clone ${GitPorxy}https://github.com/No-Github/bash-insulter.git $T_Dir/bash-insulter > /dev/null 2>&1 || Echo_ERROR2
        mv --force $T_Dir/bash-insulter/src/bash.command-not-found /etc/ && rm -rf $T_Dir/bash-insulter > /dev/null 2>&1
        chmod 777 /etc/bash.command-not-found && Echo_INFOR "最纯粹的嘴臭,最极致的享受,当你重启机器后,输错命令会有惊喜"

        case $Linux_Version in
            *"CentOS"*|*"RedHat"*|*"Fedora"*)
                echo ". /etc/bash.command-not-found" >> /etc/bashrc
                ;;
            *"Kali"*|*"Ubuntu"*|*"Debian"*)
                echo ". /etc/bash.command-not-found" >> /etc/bash.bashrc
                ;;
            *) ;;
        esac
    fi

}

# ===================== 安装 vlmcsd 环境 =====================
vlmcsd_Install(){

    name="vlmcsd"

    if test -d $T_Dir/vlmcsd
    then
        Echo_ALERT "vlmcsd 已安装在 $T_Dir/vlmcsd"
    else
        cd $T_Dir && rm -f binaries.tar.gz > /dev/null 2>&1 && $Porxy_OK wget ${GitPorxy}https://github.com/Wind4/vlmcsd/releases/download/svn1113/binaries.tar.gz > /dev/null 2>&1 || Echo_ERROR2
        tar -xzvf binaries.tar.gz 1> /dev/null 2>> /tmp/f8x_error.log
        mv binaries vlmcsd && rm -f binaries.tar.gz > /dev/null 2>&1 && Echo_INFOR "$name 已安装在 $T_Dir/vlmcsd 下,可通过以下命令运行 vlmcsd 服务:\ncd $T_Dir/vlmcsd/Linux/intel/static && ./vlmcsd-x86-musl-static"
    fi

}

# ===================== 安装 AdguardTeam 环境 =====================
AdguardTeam_Install(){

    name="AdguardTeam"

    if test -d $T_Dir/AdGuardHome
    then
        Echo_ALERT "AdguardTeam 已部署在 $T_Dir/AdGuardHome"
    else
        cd $T_Dir && rm -f $AdguardTeam_File > /dev/null 2>&1 && $Porxy_OK wget ${GitPorxy}https://github.com/AdguardTeam/AdGuardHome/releases/download/v0.105.0-beta.2/$AdguardTeam_File > /dev/null 2>&1 || Echo_ERROR2
        tar -xzvf $AdguardTeam_File 1> /dev/null 2>> /tmp/f8x_error.log && rm -f $AdguardTeam_File > /dev/null 2>&1
        cd AdGuardHome && Echo_INFOR "已安装 $name $AdGuardHome_Version 环境,运行以下命令开启 AdguardTeam 服务\n\033[0m\033[1;32mcd $T_Dir/AdGuardHome && ./AdGuardHome -s install" || Echo_ERROR "安装 $name 环境失败,请查看日志 /tmp/f8x_error.log"
    fi

}

# ===================== 安装 trash-cli 环境 =====================
trash-cli_Install(){

    name="trash-cli"

    trash-list --version 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        pip3 install trash-cli 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $name 环境,现在可使用以下命令进行管理:\n- 移动文件到回收站 : trash-put\n- 列出回收站文件 : trash-list\n- 搜索回收站文件 : trash-list | grep foo\n- 恢复回收站文件 : trash-restore\n- 删除所有回收站文件 : trash-empty\n- 删除回收站中 n 天前被回收的文件 : trash-empty <days>\n- 只删除符合某种模式的文件 : trash-rm \\\*.o" || Echo_ERROR "安装 $name 环境失败,请查看日志 /tmp/f8x_error.log"
    fi

}

# ===================== 安装 thefuck 环境 =====================
thefuck_Install(){

    name="thefuck"

    thefuck -v 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        Install_Switch4 "thefuck"
    fi

}

# ===================== 安装 fzf 环境 =====================
fzf_Install(){

    name="fzf"

    fzf --version 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        cd /tmp && rm -f $fzf_bin > /dev/null 2>&1 && $Porxy_OK wget ${GitPorxy}https://github.com/junegunn/fzf/releases/download/$fzf_Ver/$fzf_bin > /dev/null 2>&1 || Echo_ERROR2
        tar -zxvf $fzf_bin 1> /dev/null 2>> /tmp/f8x_error.log && mv fzf /usr/local/bin/fzf && chmod +x /usr/local/bin/fzf && rm -f $fzf_bin > /dev/null 2>&1
        fzf --version 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $name" || Echo_ERROR3
    fi

}

# ===================== 安装 annie 环境 =====================
annie_Install(){

    name="annie"

    annie -v 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        cd /tmp && rm -f $annie_bin > /dev/null 2>&1 && $Porxy_OK wget ${GitPorxy}https://github.com/iawia002/annie/releases/download/$annie_Ver/$annie_bin > /dev/null 2>&1 || Echo_ERROR2
        tar -zxvf $annie_bin 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "解压 /tmp/$annie_bin 失败,请查看日志 /tmp/f8x_error.log"
        mv annie /usr/local/bin/annie && chmod +x /usr/local/bin/annie && rm -f $annie_bin > /dev/null 2>&1
        annie -v 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $name $annie_Ver 在 /usr/local/bin/ 目录下,直接输入 annie 即可使用" || Echo_ERROR3
    fi

}

# ===================== 安装 you-get 环境 =====================
you-get_Install(){

    name="you-get"

    you-get --version 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        Install_Switch4 "you-get"
    fi

}

# ===================== 安装 ffmpeg 环境 =====================
ffmpeg_Install(){

    name="ffmpeg"

    ffmpeg -h 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        Rm_Lock
        case $Linux_Version in
            *"CentOS"*|*"RedHat"*|*"Fedora"*)
                Echo_INFOR "RedHat 系较为麻烦,本项 Pass\n"
                ;;
            *"Kali"*|*"Ubuntu"*|*"Debian"*)
                Install_Switch "ffmpeg"
                ;;
            *) ;;
        esac
    fi

}

# ===================== 安装 aria2 环境 =====================
aria2_Install(){

    name="aria2"

    aria2c --version 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        Rm_Lock
        Install_Switch "aria2"
    fi

    Echo_INFOR "推荐使用该项目脚本增强配置 : https://github.com/P3TERX/aria2.sh"
    Echo_INFOR "wget -N git.io/aria2.sh && chmod +x aria2.sh && bash aria2.sh"

}

# ===================== 安装 filebrowser 环境 =====================
filebrowser_Install(){

    name="filebrowser"

    filebrowser version 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装,运行以下命令开启服务:"
    else
        cd /tmp && $Porxy_OK curl -o install.sh https://raw.githubusercontent.com/filebrowser/get/master/get.sh > /dev/null 2>&1 && $Porxy_OK bash install.sh > /dev/null 2>&1 && Echo_INFOR "已安装 $name ,运行以下命令开启服务:" || Echo_ERROR2
    fi

    Echo_INFOR "filebrowser -a [监听的IP] -r [文件夹路径]" && Echo_INFOR "默认账号密码 admin"

}

# ===================== 安装 sharry =====================
sharry_Install(){

    name="sharry"

    if test -d $T_Dir/$name
    then
        Echo_ALERT "$name 已部署在 $T_Dir/$name ,运行以下命令开启服务:"
    else
        cd $T_Dir/ && Echo_ALERT "正在下载 $name 安装包(70M),该步骤可能运行较长时间,请耐心等待" && $Porxy_OK wget ${GitPorxy}https://github.com/eikek/sharry/releases/download/release/$sharry_Ver/$sharry_File > /dev/null 2>&1 || Echo_ERROR2
        unzip $sharry_File 1> /dev/null 2>> /tmp/f8x_error.log && rm -f $sharry_File > /dev/null 2>&1 && mv sharry-restserver-1.6.0 sharry && Echo_INFOR "已安装 $name 服务,运行以下命令开启服务:" || Echo_ERROR "安装 $name 环境失败"
    fi

    Echo_INFOR "$T_Dir/sharry/bin/sharry-restserver ,该服务需要 jdk 环境,若未安装可运行 -oraclejdk 选项进行安装"

}

# ===================== 安装 starship =====================
starship_Install(){

    name="starship"

    starship --version 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        cd /tmp && rm -f install.sh > /dev/null 2>&1 && $Porxy_OK curl -o install.sh https://starship.rs/install.sh > /dev/null 2>&1 && $Porxy_OK bash install.sh && Echo_INFOR "已安装 $name" || Echo_ERROR2
    fi

    Echo_INFOR "Bash 配置:  echo \"eval \\\"\\\$(starship init bash)\\\"\" >> ~/.bashrc"
    Echo_INFOR "Fish 配置:  echo \"starship init fish | source\" >> ~/.config/fish/config.fish"
    Echo_INFOR "Zsh  配置:  echo \"eval \\\"\\\$(starship init zsh)\\\"\" >> ~/.zshrc"

}

# -vol
Volatility_Install(){

    echo -e "\033[1;33m\n>> 正在安装 Volatility ,请耐心等待 \n\033[0m"
    name="Volatility"

    case $Linux_Version in
        *"Ubuntu"*|*"Debian"*)

            volatility --info 1> /dev/null 2>> /tmp/f8x_error.log

            if [ $? == 0 ]
            then
                Echo_ALERT "$name 已安装"
            else
                Rm_Lock
                Install_Switch3 "distorm3==3.4.4"
                Install_Switch3 "yara-python"
                ln -s /usr/local/lib/python2.7/dist-packages/usr/lib/libyara.so /usr/lib/libyara.so 1> /dev/null 2>> /tmp/f8x_error.log
                Install_Switch "volatility"
            fi

            ;;
        *)
            if test -d $P_Dir/volatility
            then
                Echo_ALERT "$name 已安装在 $P_Dir/volatility"
            else
                Rm_Lock
                case $Linux_Version in
                    *"CentOS"*|*"RedHat"*|*"Fedora"*)
                        Install_Switch "pcre-devel"
                        Install_Switch "libpcre++-devel"
                        Install_Switch "python-devel"
                        Install_Switch "pycrypto"
                        ;;
                    *) ;;
                esac

                Install_Switch3 "distorm3==3.4.4"
                Install_Switch3 "yara-python"
                ln -s /usr/local/lib/python2.7/dist-packages/usr/lib/libyara.so /usr/lib/libyara.so 1> /dev/null 2>> /tmp/f8x_error.log

                $Porxy_OK git clone ${GitPorxy}https://github.com/volatilityfoundation/volatility.git $P_Dir/volatility 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已下载 $name" || Echo_ERROR2
                cd $P_Dir/volatility && python setup.py build 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "安装依赖模块失败,请查看日志 /tmp/f8x_error.log"
                python setup.py install 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "安装依赖模块失败,请查看日志 /tmp/f8x_error.log"
                python vol.py --info 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $name 在 $P_Dir/volatility 路径" || Echo_ERROR "安装 $name 失败,请查看日志 /tmp/f8x_error.log"
            fi
            ;;
    esac

}

# -vol3
volatility3_Install(){

    echo -e "\033[1;33m\n>> 正在安装 volatility3 ,请耐心等待 \n\033[0m"
    name="volatility3"

    if test -d $P_Dir/volatility3
    then
        Echo_ALERT "$name 已安装在 $P_Dir/volatility3"
    else
        $Porxy_OK git clone ${GitPorxy}https://github.com/volatilityfoundation/volatility3.git $P_Dir/volatility3 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已下载 $name" || Echo_ERROR2
        cd $P_Dir/volatility3 && python3 setup.py build 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "安装依赖模块失败,请查看日志 /tmp/f8x_error.log"
        python3 setup.py install 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "安装依赖模块失败,请查看日志 /tmp/f8x_error.log"
        python3 vol.py -h 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $name 在 $P_Dir/volatility3 路径" || Echo_ERROR "安装 Volatility3 失败,请查看日志 /tmp/f8x_error.log"
    fi

    if test -d $P_Dir/volatility3/symbols
    then
        Echo_ALERT "$P_Dir/volatility3/symbols 文件夹已存在"
    else
        echo -e "\033[1;33m\n>> 正在下载 Symbol Tables ,请耐心等待 \n\033[0m"
        cd /tmp && $Porxy_OK wget downloads.volatilityfoundation.org/volatility3/symbols/windows.zip > /dev/null 2>&1
        $Porxy_OK wget downloads.volatilityfoundation.org/volatility3/symbols/mac.zip > /dev/null 2>&1
        $Porxy_OK wget downloads.volatilityfoundation.org/volatility3/symbols/linux.zip > /dev/null 2>&1
        mkdir -p $P_Dir/volatility3/symbols
        mv /tmp/windows.zip $P_Dir/volatility3/symbols && Echo_INFOR "已下载 windows Symbol Tables 在 $P_Dir/volatility3/symbols " || Echo_ERROR "windows Symbol Tables 下载失败"
        mv /tmp/mac.zip $P_Dir/volatility3/symbols && Echo_INFOR "已下载 mac Symbol Tables 在 $P_Dir/volatility3/symbols " || Echo_ERROR "windows Symbol Tables 下载失败"
        mv /tmp/linux.zip $P_Dir/volatility3/symbols && Echo_INFOR "已下载 linux Symbol Tables 在 $P_Dir/volatility3/symbols " || Echo_ERROR "windows Symbol Tables 下载失败"
    fi

}

# -hfish
hfish_Install(){

    echo -e "\033[1;33m\n>> 正在检测 Docker 可用性\n\033[0m"
    Docker_Install

    echo -e "\033[1;33m\n>> 正在部署 hfish 环境\n\033[0m"
    docker pull imdevops/hfish && Echo_INFOR "已拉取最新版 hfish 镜像, 请通过下列命令运行:\ndocker run -d --name hfish -p 21:21 -p 2222:22 -p 23:23 -p 69:69 -p 3306:3306 -p 5900:5900 -p 6379:6379 -p 8080:8080 -p 8081:8081 -p 8989:8989 -p 9000:9000 -p 9001:9001 -p 9200:9200 -p 11211:11211 -e USERNAME=ffff1234SFG -e PASSWORD=ffff1234SFG --restart=always imdevops/hfish:latest\n\n-browser access：http://[IP_Address]:9001/\n-环境变量API_IP的值为 API 的 IP 地址加端口组成\n-默认帐号密码均为：ffff1234SFG 如需修改可以通过修改 -e USERNAME= -e PASSWORD= 环境变量进行修改\n-如需做数据持久化存储，可加参数 -v \$PWD:/opt 挂载数据卷到宿主机上，避免容器删除数据丢失" || Echo_ERROR "部署 hfish 环境失败,请查看日志 /tmp/f8x_error.log"

}

# -lt
lt_Install(){

    echo -e "\033[1;33m\n>> 正在检测 Docker 可用性\n\033[0m"
    Docker_Install

    echo -e "\033[1;33m\n>> 正在部署 LogonTracer 环境\n\033[0m"
    docker pull jpcertcc/docker-logontracer && Echo_INFOR "已拉取最新版 LogonTracer 镜像, 请通过下列命令运行:\ndocker run --name logontracer --detach -p 7474:7474 -p 7687:7687 -p 8080:8080 -e LTHOSTNAME=[IP_Address] jpcertcc/docker-logontracer\n\n-browser access：http://[IP_Address]:8080/" || Echo_ERROR "部署 LogonTracer 环境失败,请查看日志 /tmp/f8x_error.log"

}

# -binwalk
binwalk_Install(){

    name="binwalk"

    echo -e "\033[1;33m\n>> 正在安装 binwalk 及相关组件\n\033[0m"
    case $Linux_Version in
        *"CentOS"*|*"RedHat"*|*"Fedora"*)
            Echo_INFOR "RedHat 系不建议安装,本项 Pass\n"
            ;;
        *"Kali"*|*"Ubuntu"*|*"Debian"*)
            Echo_ALERT "正在安装 binwalk,该步骤可能运行很长时间,请看部电影"
            cd $T_Dir && rm -rf binwalk > /dev/null 2>&1 && $Porxy_OK git clone ${GitPorxy}https://github.com/ReFirmLabs/binwalk.git 1> /dev/null 2>> /tmp/f8x_error.log && cd binwalk 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR2
            $Porxy_OK sudo ./deps.sh && python setup.py uninstall && python setup.py install
            binwalk -h 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 binwalk" || Echo_ERROR "binwalk 安装失败!建议使用 -binwalk-force 进行强制安装"
            echo -e "\033[1;33m\n>> 正在安装 unyaffs\n\033[0m"
            unyaffs_Install
            ;;
        *) ;;
    esac

}

# -binwalk-force
binwalk_force_Install(){

    echo -e "\033[1;33m\n>> 正在安装 binwalk 及相关组件\n\033[0m"
    case $Linux_Version in
        *"CentOS"*|*"RedHat"*|*"Fedora"*)
            Echo_INFOR "RedHat 系不建议安装,本项 Pass\n"
            ;;
        *"Kali"*|*"Ubuntu"*|*"Debian"*)
            Rm_Lock
            Install_Switch "python3-pip"
            Install_Switch "python-lzma"
            Install_Switch "python3-crypto"
            Install_Switch "libqt4-opengl"
            Install_Switch "python3-opengl"
            Install_Switch "python3-pyqt4"
            Install_Switch "python3-pyqt4.qtopengl"
            Install_Switch "python3-numpy"
            Install_Switch "python3-scipy"
            Install_Switch "python3-pip"
            Install_Switch "mtd-utils"
            Install_Switch "gzip"
            Install_Switch "bzip2"
            Install_Switch "tar"
            Install_Switch "arj"
            Install_Switch "lhasa"
            Install_Switch "p7zip"
            Install_Switch "p7zip-full"
            Install_Switch "cabextract"
            Install_Switch "cramfsprogs"
            Install_Switch "cramfsswap"
            Install_Switch "squashfs-tools"
            Install_Switch "sleuthkit"
            Install_Switch "default-jdk"
            Install_Switch "lzop"
            Install_Switch "srecord"
            Install_Switch "zlib1g-dev"
            Install_Switch "liblzma-dev"
            Install_Switch "liblzo2-dev"
            Install_Switch "python-lzo"
            pip install cstruct 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 cstruct" || Echo_ERROR "安装 cstruct 失败,请查看日志 /tmp/f8x_error.log"

            Install_Switch4 "nose"
            Install_Switch4 "coverage"
            Install_Switch4 "pyqtgraph"
            Install_Switch4 "capstone"

            # sasquatch
            name="sasquatch"
            echo -e "\033[1;33m\n>> 正在安装 sasquatch\n\033[0m"
            cd $T_Dir && rm -rf sasquatch > /dev/null 2>&1 && $Porxy_OK git clone ${GitPorxy}https://github.com/devttys0/sasquatch > /dev/null 2>&1 && cd sasquatch || Echo_ERROR2
            $Porxy_OK ./build.sh 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 sasquatch" || Echo_ERROR3

            # jefferson
            name="jefferson"
            echo -e "\033[1;33m\n>> 正在安装 jefferson\n\033[0m"
            cd $T_Dir && rm -rf jefferson > /dev/null 2>&1 && $Porxy_OK git clone ${GitPorxy}https://github.com/sviehb/jefferson > /dev/null 2>&1 && cd jefferson || Echo_ERROR2
            $Porxy_OK python setup.py install 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 jefferson" || Echo_ERROR3

            # ubi_reader
            name="ubi_reader"
            echo -e "\033[1;33m\n>> 正在安装 ubi_reader\n\033[0m"
            cd $T_Dir && rm -rf ubi_reader > /dev/null 2>&1 && $Porxy_OK git clone ${GitPorxy}https://github.com/jrspruitt/ubi_reader > /dev/null 2>&1 && cd ubi_reader || Echo_ERROR2
            $Porxy_OK python setup.py install 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 ubi_reader" || Echo_ERROR3

            # yaffshiv
            name="yaffshiv"
            echo -e "\033[1;33m\n>> 正在安装 yaffshiv\n\033[0m"
            cd $T_Dir && rm -rf yaffshiv > /dev/null 2>&1 && $Porxy_OK git clone ${GitPorxy}https://github.com/devttys0/yaffshiv > /dev/null 2>&1 && cd yaffshiv || Echo_ERROR2
            $Porxy_OK python setup.py install 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 yaffshiv" || Echo_ERROR3

            # unstuff
            name="unstuff"
            echo -e "\033[1;33m\n>> 正在安装 unstuff\n\033[0m"
            cd $T_Dir && $Porxy_OK curl -o stuffit520.611linux-i386.tar.gz http://downloads.tuxfamily.org/sdtraces/stuffit520.611linux-i386.tar.gz > /dev/null 2>&1 | tar -zxvf stuffit520.611linux-i386.tar.gz > /dev/null 2>&1
            mv --force bin/unstuff /usr/local/bin/ && Echo_INFOR "已安装 unstuff" || Echo_ERROR3

            # unyaffs
            name="unyaffs"
            echo -e "\033[1;33m\n>> 正在安装 unyaffs\n\033[0m"
            unyaffs_Install

            # binwalk
            name="binwalk"
            echo -e "\033[1;33m\n>> 正在安装 binwalk,耐心等待\n\033[0m"
            cd $T_Dir && rm -rf binwalk > /dev/null 2>&1 && $Porxy_OK git clone ${GitPorxy}https://github.com/ReFirmLabs/binwalk > /dev/null 2>&1 && cd binwalk || Echo_ERROR2

            python3 setup.py install 1> /dev/null 2>> /tmp/f8x_error.log

            binwalk -h 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $name" || Echo_ERROR3
            ;;
        *) ;;
    esac

}

# -clamav
clamav_Install(){

    echo -e "\033[1;33m\n>> 正在安装 clamav\n\033[0m"

    name="clamav"
    clamscan --version 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        Rm_Lock
        case $Linux_Version in
            *"CentOS"*|*"RedHat"*|*"Fedora"*)
                Install_Switch "clamav"
                Install_Switch "clamav-update"
                $Porxy_OK freshclam
                ;;
            *"Kali"*|*"Ubuntu"*|*"Debian"*)
                Install_Switch "clamav"
                systemctl stop clamav-freshclam.service
                $Porxy_OK freshclam -v
                ;;
            *) ;;
        esac
    fi

}

# -python2
Python2_Install(){

    echo -e "\033[1;33m\n>> 正在安装 python2\n\033[0m"

    Rm_Lock
    case $Linux_Version in
        *"CentOS"*|*"RedHat"*)

            ( (python -h 1> /dev/null 2>> /tmp/f8x_error.log || python2 -h 1> /dev/null 2>> /tmp/f8x_error.log) && Echo_INFOR "已安装 python2" ) || ( ( (yum install -y python 1> /dev/null 2>> /tmp/f8x_error.log || yum install -y python2 1> /dev/null 2>> /tmp/f8x_error.log) && Echo_INFOR "已安装 python2") || Echo_ERROR "安装 python 失败! 请尽量手动安装,否则会出现大量依赖问题!")

            ( yum install -y python-devel 1> /dev/null 2>> /tmp/f8x_error.log || yum install -y python2-devel 1> /dev/null 2>> /tmp/f8x_error.log) && Echo_INFOR "已安装 python-devel" || Echo_ERROR "安装 python-devel 失败,请查看日志 /tmp/f8x_error.log"
            ( yum install -y python2-pip 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 python2-pip" ) || ( Echo_ERROR "安装 python2-pip 失败! 即将自动运行 -pip2-force 选项安装 python2-pip 环境" && pip2_Install )
            ;;
        *"Fedora"*)
            yum install -y python 1> /dev/null 2>> /tmp/f8x_error.log
            yum install -y python2 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 python2" || Echo_ERROR "安装 python 失败! 请尽量手动安装,否则会出现大量依赖问题!"
            yum install -y python-devel 1> /dev/null 2>> /tmp/f8x_error.log
            yum install -y python2-devel 1> /dev/null 2>> /tmp/f8x_error.log
            ( yum install -y python2-pip 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 python2-pip" ) || ( Echo_ERROR "安装 python2-pip 失败! 即将自动运行 -pip2-force 选项安装 python2-pip 环境" && pip2_Install )
            ;;
        *"Kali"*|*"Ubuntu"*|*"Debian"*)
            Install_Switch "python"
            Install_Switch "python-dev"
            ( apt-get install -y python-pip 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 python2-pip" ) || ( Echo_ERROR "安装 python2-pip 失败! 即将自动运行 -pip2-force 选项安装 python2-pip 环境" && pip2_Install )

            Install_Switch3 "setuptools"
            ;;
        *) ;;
    esac

}

# -pip2-force
pip2_Install(){

    if [ $GitPorxy ==  ]
    then
        echo -e "\033[1;33m\n>> 正在安装 pip2\n\033[0m"
        cd $T_Dir && $Porxy_OK curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR " https://bootstrap.pypa.io/get-pip.py 下载失败! 请检查 proxychains4 配置的代理服务器是否可用"
        $Porxy_OK python2 get-pip.py 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 python-pip" || Echo_ERROR "安装 python-pip 失败,请查看日志 /tmp/f8x_error.log"
        rm -f get-pip.py > /dev/null 2>&1

        Install_Switch3 "setuptools"
    fi

}

# -ruby
Ruby_Install(){

    name="ruby"

    echo -e "\033[1;33m\n>> 正在安装 Ruby,时间超长,建议看会视频,耐心等待,编译过程中出现 warning 告警请无视\n\033[0m"
    cd $T_Dir && rm -f $Ruby_Install > /dev/null 2>&1 && $Porxy_OK wget https://cache.ruby-lang.org/pub/ruby/$Ruby_Ver/ruby-3.0.0.tar.gz 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR2
    tar xvfvz $Ruby_Install 1> /dev/null 2>> /tmp/f8x_error.log
    cd $Ruby_Dir && ./configure 1> /dev/null 2>> /tmp/f8x_error.log && make 1> /dev/null 2>> /tmp/f8x_error.log && make install 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $(ruby -v) 安装在 /usr/local/bin/ 目录下" || Echo_ERROR "安装 Ruby 环境失败,请查看日志 /tmp/f8x_error.log"

}

# -rust
Rust_Install(){

    name="rust"

    echo -e "\033[1;33m\n>> 正在安装 rust (注意安装时选项)\n\033[0m"
    $Porxy_OK curl https://sh.rustup.rs -sSf | $Porxy_OK sh

}

# -chromium
chromium_Install(){

    echo -e "\033[1;33m\n>> 正在安装大量依赖库,时间较长,请耐心等待\n\033[0m"

    name="chromium"

    Rm_Lock
    case $Linux_Version in
        *"CentOS"*|*"RedHat"*|*"Fedora"*)
            Install_Switch "pango.x86_64"
            Install_Switch "libXcomposite.x86_64"
            Install_Switch "libXcursor.x86_64"
            Install_Switch "libXdamage.x86_64"
            Install_Switch "libXext.x86_64"
            Install_Switch "libXi.x86_64"
            Install_Switch "libXtst.x86_64"
            Install_Switch "cups-libs.x86_64"
            Install_Switch "libXScrnSaver.x86_64"
            Install_Switch "libXrandr.x86_64"
            Install_Switch "libX11-xcb.x86_64"
            Install_Switch "GConf2.x86_64"
            Install_Switch "alsa-lib.x86_64"
            Install_Switch "atk.x86_64"
            Install_Switch "gtk3.x86_64"
            Install_Switch "ipa-gothic-fonts"
            Install_Switch "xorg-x11-fonts-100dpi"
            Install_Switch "xorg-x11-fonts-75dpi"
            Install_Switch "xorg-x11-utils"
            Install_Switch "xorg-x11-fonts-cyrillic"
            Install_Switch "xorg-x11-fonts-Type1"
            Install_Switch "xorg-x11-fonts-misc"
            ;;
        *"Kali"*|*"Ubuntu"*|*"Debian"*)
            Install_Switch2 "libasound2"
            Install_Switch2 "libatk1.0-0"
            Install_Switch2 "libc6"
            Install_Switch2 "libcairo2"
            Install_Switch2 "libcups2"
            Install_Switch2 "libdbus-1-3"
            Install_Switch2 "libexpat1"
            Install_Switch2 "libfontconfig1"
            Install_Switch2 "libgcc1"
            Install_Switch2 "libgconf-2-4"
            Install_Switch2 "libgdk-pixbuf2.0-0"
            Install_Switch2 "libglib2.0-0"
            Install_Switch2 "libgtk-3-0"
            Install_Switch2 "libnspr4"
            Install_Switch2 "libpango-1.0-0"
            Install_Switch2 "libpangocairo-1.0-0"
            Install_Switch2 "libstdc++6"
            Install_Switch2 "libx11-6"
            Install_Switch2 "libx11-xcb1"
            Install_Switch2 "libxcb1"
            Install_Switch2 "libxcursor1"
            Install_Switch2 "libxdamage1"
            Install_Switch2 "libxext6"
            Install_Switch2 "libxfixes3"
            Install_Switch2 "libxi6"
            Install_Switch2 "libxrandr2"
            Install_Switch2 "libxrender1"
            Install_Switch2 "libxss1"
            Install_Switch2 "libxtst6"
            Install_Switch2 "libnss3"
            ;;
        *) ;;
    esac

    echo -e "\033[1;33m\n>> 正在安装 chromium (120M)\n\033[0m"

    cd $T_Dir && rm -rf chrome-linux* > /dev/null 2>&1 && $Porxy_OK wget https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/706915/chrome-linux.zip 1> /dev/null 2>> /tmp/f8x_error.log

    unzip chrome-linux.zip 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 chromium 环境在 $T_Dir/chrome-linux " || Echo_ERROR "安装 chromium 环境失败,请查看日志 /tmp/f8x_error.log"
    rm -f chrome-linux.zip > /dev/null 2>&1

}

# -openjdk
Openjdk_Install(){

    name="openjdk"

    java -version > /dev/null 2>&1

    if [ $? == 0 ]
    then
        Echo_INFOR "已安装 java 环境"
    else
        echo -e "\033[1;33m\n>> 正在安装 Java 环境\n\033[0m"
        Rm_Lock
        case $Linux_Version in
            *"CentOS"*|*"RedHat"*|*"Fedora"*)
                Install_Switch "java-1.8.0-openjdk"
                Install_Switch "java-1.8.0-openjdk-devel"
                java -version && Echo_INFOR "已安装 java 环境" || Echo_ERROR "安装 java 环境失败,请查看日志 /tmp/f8x_error.log"
                ;;
            *"Kali"*|*"Ubuntu"*|*"Debian"*)
                Install_Switch "openjdk-11-jdk"
                java -version && Echo_INFOR "已安装 java 环境" || Echo_ERROR "安装 java 环境失败,请查看日志 /tmp/f8x_error.log"
                ;;
            *) ;;
        esac
    fi

}

# -oraclejdk
Oraclejdk_Install(){

    name="oraclejdk"

    java -version > /dev/null 2>&1

    if [ $? == 0 ]
    then
        Echo_INFOR "已安装 java 环境"
    else
        echo -e "\033[1;33m\n>> 正在安装 Java 环境\n\033[0m"
        case $Linux_Version in
            *"CentOS"*|*"RedHat"*|*"Fedora"*)
                cd $T_Dir && rm -f targz.z* > /dev/null 2>&1 && $Porxy_OK wget -O targz.z01 ${GitPorxy2}https://raw.githubusercontent.com/No-Github/Archive/master/JDK/targz/targz.z01 > /dev/null 2>&1 || Echo_ERROR "下载 targz.z01 失败! 请检查 proxychains4 配置的代理服务器是否可用"
                $Porxy_OK wget -O targz.z02 ${GitPorxy2}https://raw.githubusercontent.com/No-Github/Archive/master/JDK/targz/targz.z02 > /dev/null 2>&1 || Echo_ERROR "下载 targz.z02 失败! 请检查 proxychains4 配置的代理服务器是否可用"
                $Porxy_OK wget -O targz.z03 ${GitPorxy2}https://raw.githubusercontent.com/No-Github/Archive/master/JDK/targz/targz.z03 > /dev/null 2>&1 || Echo_ERROR "下载 targz.z03 失败! 请检查 proxychains4 配置的代理服务器是否可用"
                $Porxy_OK wget -O targz.zip ${GitPorxy2}https://raw.githubusercontent.com/No-Github/Archive/master/JDK/targz/targz.zip > /dev/null 2>&1 || Echo_ERROR "下载 targz.zip 失败! 请检查 proxychains4 配置的代理服务器是否可用"
                rm -rf jdk* > /dev/null 2>&1 && rm -f myzip.zip > /dev/null 2>&1
                cat targz.z* > myzip.zip && unzip myzip.zip 1> /dev/null 2>> /tmp/f8x_error.log
                tar -xzvf jdk-8u271-linux-x64.tar.gz 1> /dev/null 2>> /tmp/f8x_error.log
                rm -rf /usr/local/java/ > /dev/null 2>&1 && mkdir /usr/local/java/
                mv $jdk_Version/ /usr/local/java
                echo "JAVA_HOME=/usr/local/java/$jdk_Version" >> /etc/bashrc
                echo "JRE_HOME=\$JAVA_HOME/jre" >> /etc/bashrc
                echo "CLASSPATH=.:\$JAVA_HOME/lib:\$JRE_HOME/lib" >> /etc/bashrc
                echo "PATH=\$PATH:\$JAVA_HOME/bin" >> /etc/bashrc
                ln -s /usr/local/java/$jdk_Version/bin/java /usr/bin/java 1> /dev/null 2>> /tmp/f8x_error.log
                ln -s /usr/local/java/$jdk_Version/bin/keytool /usr/bin/keytool 1> /dev/null 2>> /tmp/f8x_error.log
                /usr/bin/java -version && Echo_INFOR "已安装 java 环境,环境变量可能需要重新进入 bash 才能生效" || Echo_ERROR "安装 java 环境失败!(在 Redhat 系下会有误报,请手动执行 java -version 看下,珍爱生命,远离 Redhat 系!环境变量需要重新进入 bash 才能生效或手动执行下列命令生效\nexport JAVA_HOME=/usr/local/java/$jdk_Version\nexport JRE_HOME=\$JAVA_HOME/jre\nexport CLASSPATH=.:\$JAVA_HOME/lib:\$JRE_HOME/lib\nexport PATH=\$JAVA_HOME/bin:\$PATH)"
                rm -f targz.z* > /dev/null 2>&1
                rm -f jdk-8u271-linux-x64.tar.gz > /dev/null 2>&1
                rm -f myzip.zip > /dev/null 2>&1
                ;;
            *"Kali"*|*"Ubuntu"*|*"Debian"*)
                cd $T_Dir && rm -f targz.z* 1> /dev/null 2>> /tmp/f8x_error.log && $Porxy_OK wget -O targz.z01 ${GitPorxy2}https://raw.githubusercontent.com/No-Github/Archive/master/JDK/targz/targz.z01 > /dev/null 2>&1 || Echo_ERROR "下载 targz.z01 失败! 请检查 proxychains4 配置的代理服务器是否可用"
                $Porxy_OK wget -O targz.z02 ${GitPorxy2}https://raw.githubusercontent.com/No-Github/Archive/master/JDK/targz/targz.z02 > /dev/null 2>&1 || Echo_ERROR "下载 targz.z02 失败! 请检查 proxychains4 配置的代理服务器是否可用"
                $Porxy_OK wget -O targz.z03 ${GitPorxy2}https://raw.githubusercontent.com/No-Github/Archive/master/JDK/targz/targz.z03 > /dev/null 2>&1 || Echo_ERROR "下载 targz.z03 失败! 请检查 proxychains4 配置的代理服务器是否可用"
                $Porxy_OK wget -O targz.zip ${GitPorxy2}https://raw.githubusercontent.com/No-Github/Archive/master/JDK/targz/targz.zip > /dev/null 2>&1 || Echo_ERROR "下载 targz.zip 失败! 请检查 proxychains4 配置的代理服务器是否可用"
                rm -rf jdk* > /dev/null 2>&1 && rm -f myzip.zip > /dev/null 2>&1
                cat targz.z* > myzip.zip && unzip myzip.zip 1> /dev/null 2>> /tmp/f8x_error.log
                tar -xzvf jdk-8u271-linux-x64.tar.gz 1> /dev/null 2>> /tmp/f8x_error.log
                rm -rf /usr/local/java/ > /dev/null 2>&1 && mkdir /usr/local/java/
                mv $jdk_Version/ /usr/local/java
                echo "JAVA_HOME=/usr/local/java/$jdk_Version " >> /etc/bash.bashrc
                echo "JRE_HOME=\$JAVA_HOME/jre " >> /etc/bash.bashrc
                echo "CLASSPATH=.:\$JAVA_HOME/lib:\$JRE_HOME/lib " >> /etc/bash.bashrc
                echo "PATH=\$JAVA_HOME/bin:\$PATH " >> /etc/bash.bashrc
                ln -s /usr/local/java/$jdk_Version/bin/java /usr/bin/java 1> /dev/null 2>> /tmp/f8x_error.log
                /usr/bin/java -version && Echo_INFOR "已安装 java 环境,环境变量需要重新进入 bash 才能生效或手动执行下列命令生效\nexport JAVA_HOME=/usr/local/java/$jdk_Version\nexport JRE_HOME=\$JAVA_HOME/jre\nexport CLASSPATH=.:\$JAVA_HOME/lib:\$JRE_HOME/lib\nexport PATH=\$JAVA_HOME/bin:\$PATH" || Echo_ERROR "安装 java 环境失败,请查看日志 /tmp/f8x_error.log"
                rm -f targz.z* > /dev/null 2>&1
                rm -f jdk-8u271-linux-x64.tar.gz > /dev/null 2>&1
                rm -f myzip.zip > /dev/null 2>&1
                ;;
            *) ;;
        esac
    fi

}

# -perl
Perl_Install(){

    name="perl"

    echo -e "\033[1;33m\n>> 正在安装 perl(注意安装时选项,安装时若长时间无反应请按几下回车,并且在安装完毕后需手动 exit 退出)\n\033[0m" && cd $T_Dir && $Porxy_OK sh <(curl -q https://platform.activestate.com/dl/cli/install.sh) --activate-default ActiveState/ActivePerl-5.28

}

# -nn
nn_Install(){

    echo -e "\033[1;33m\n>> 正在安装 nodejs && npm\n\033[0m"

    name="nodejs"

    if test -e /usr/local/bin/node
    then
        Echo_ALERT "nodejs && npm 已存在,若非管理员安装,建议追踪 /usr/local/bin/node 文件 "
    else
        cd /tmp && $Porxy_OK wget https://nodejs.org/dist/$node_Ver/$node_bin > /dev/null 2>&1 && Echo_INFOR "已下载 $node_bin " || Echo_ERROR "$node_bin 下载失败! 请检查 proxychains4 配置的代理服务器是否可用"
        mkdir /usr/local/nodejs/ && tar -C /usr/local/nodejs -xvJf $node_bin > /dev/null 2>&1 && rm $node_bin
        ln -s /usr/local/nodejs/$node_Dir/bin/node /usr/local/bin/node && Echo_INFOR "已安装 nodejs" || Echo_ERROR "安装 nodejs 失败!"
        ln -s /usr/local/nodejs/$node_Dir/bin/npm /usr/local/bin/npm && Echo_INFOR "已安装 npm" || Echo_ERROR "安装 npm 失败,请查看日志 /tmp/f8x_error.log"
    fi

}

# -vulhub
vulhub_Install(){

    Pentest_Base_Install

    name="vulhub"

    echo -e "\033[1;33m\n>> 正在部署 vulhub 环境\n\033[0m"

    cd $P_Dir && rm -rf vulhub 1> /dev/null 2>> /tmp/f8x_error.log && Echo_ALERT "正在下载 vulhub 环境,该步骤可能运行较长时间,请耐心等待" && $Porxy_OK git clone ${GitPorxy}https://github.com/vulhub/vulhub 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "下载 vulhub 失败! 请检查 proxychains4 配置的代理服务器是否可用"
    cd vulhub && Echo_INFOR "已部署最新版 vulhub 在 $P_Dir/vulhub 目录下" || Echo_ERROR "部署 vulhub 环境失败,请查看日志 /tmp/f8x_error.log"

}

# -vulfocus
vulfocus_Install(){

    echo -e "\033[1;33m\n>> 正在检测 Docker 可用性\n\033[0m"
    Docker_Install

    echo -e "\033[1;33m\n>> 正在部署 vulfocus 环境\n\033[0m"
    docker pull vulfocus/vulfocus:latest && Echo_INFOR "已拉取最新版 vulfocus 请通过下列命令运行:\ndocker run -d -p 80:80 -v /var/run/docker.sock:/var/run/docker.sock  -e VUL_IP=xxx.xxx.xxx.xxx vulfocus/vulfocus\n\n-v /var/run/docker.sock:/var/run/docker.sock 为 docker 交互连接。\n-e DOCKER_URL 为 Docker 连接方式，默认通过 unix://var/run/docker.sock 进行连接，也可以通过 tcp://xxx.xxx.xxx.xxx:2375 进行连接（必须开放 2375 端口）。\n-v /vulfocus-api/db.sqlite3:db.sqlite3 映射数据库为本地文件。\n-e VUL_IP=xxx.xxx.xxx.xxx 为 Docker 服务器 IP ，不能为 127.0.0.1。\n默认账户密码为 admin/admin。" || Echo_ERROR "部署 vulfocus 环境失败,请查看日志 /tmp/f8x_error.log"

}

# -goby
Goby_Install(){

    echo -e "\033[1;33m\n>> 正在部署 Goby 环境\n\033[0m"

    name="goby"

    if test -d $P_Dir/goby
    then
        Echo_INFOR "Goby 已部署在 $P_Dir/goby下,直接输入 cd $P_Dir/goby/goby* && ./goby 即可使用(需要图形化界面)"
    else

        Rm_Lock
        case $Linux_Version in
            *"CentOS"*|*"RedHat"*|*"Fedora"*)
                Install_Switch "libXScrnSaver*"
                ;;
            *"Kali"*|*"Ubuntu"*|*"Debian"*)
                Install_Switch "libgconf2"
                ;;
            *) ;;
        esac

        Echo_ALERT "正在下载 Goby 安装包(120M),该步骤可能运行较长时间,请耐心等待"
        #cd $P_Dir && mkdir -p $P_Dir/goby 1> /dev/null 2>> /tmp/f8x_error.log && $Porxy_OK wget ${GitPorxy}https://github.com/gobysec/Goby/releases/download/$goby_Ver/$goby_File > /dev/null 2>&1 || Echo_ERROR "$goby_File 下载失败! 请检查 proxychains4 配置的代理服务器是否可用"
        cd $P_Dir && mkdir -p $P_Dir/goby 1> /dev/null 2>> /tmp/f8x_error.log && wget https://cn.gobies.org/$goby_File > /dev/null 2>&1 || Echo_ERROR "$goby_File 下载失败! 请检查 proxychains4 配置的代理服务器是否可用"
        unzip $goby_File -d $P_Dir/goby 1> /dev/null 2>> /tmp/f8x_error.log && rm -f $goby_File && Echo_INFOR "已部署 Goby $goby_Ver 在 $P_Dir/goby 目录下,直接输入 cd $P_Dir/goby/goby* && ./goby 即可使用(需要图形化界面)" || Echo_ERROR "goby 部署失败,请查看日志 /tmp/f8x_error.log"
    fi

    if test -d $P_Dir/goby
    then

        echo -e "\033[5;33m\n请设置服务端账号(特殊字符请在前面加反斜杠 \"\\\" 转义)\033[0m" && read -r input
        Goby_User=$input
        echo -e "\033[5;33m\n请设置服务端密码(特殊字符请在前面加反斜杠 \"\\\" 转义)\033[0m" && read -r input
        Goby_Pass=$input
        Echo_INFOR "请运行以下命令:\n\033[0m\033[1;32mcd $P_Dir/goby/goby*/golib && nohup ./goby-cmd-linux -apiauth $Goby_User:$Goby_Pass -mode api -bind 0.0.0.0:8361 & "

    else
        Echo_ERROR "未安装 Goby ,或不在指定路径"
    fi

}

# -awvs13
awvs13_Install(){

    echo -e "\033[1;33m\n>> 正在检测 Docker 可用性\n\033[0m"
    Docker_Install

    echo -e "\033[1;33m\n>> 正在部署 awvs13 环境\n\033[0m"
    docker pull secfa/docker-awvs && Echo_INFOR "已拉取最新版 awvs13 镜像, 请通过下列命令运行:\ndocker run -it -d -p 13443:3443 secfa/docker-awvs\n\n-awvs13 username: admin@admin.com\n-awvs13 password: Admin123\n-AWVS Version：13.0.200217097\n-browser access：https://127.0.0.1:13443/\n" || Echo_ERROR "部署 awvs13 环境失败,请查看日志 /tmp/f8x_error.log"

    Echo_INFOR "推荐使用该项目脚本增强配置 : https://github.com/test502git/awvs13_batch_py3"

}

# -mobsf
mobsf_Install(){

    echo -e "\033[1;33m\n>> 正在检测 Docker 可用性\n\033[0m"
    Docker_Install

    echo -e "\033[1;33m\n>> 正在部署 MobSF 环境\n\033[0m"
    docker pull opensecurity/mobile-security-framework-mobsf && Echo_INFOR "已拉取最新版 MobSF 镜像, 请通过下列命令运行:\n$Porxy_OK docker run -it --rm -p 8000:8000 opensecurity/mobile-security-framework-mobsf:latest\n\n-browser access：http://127.0.0.1:8000/" || Echo_ERROR "部署 MobSF 环境失败,请查看日志 /tmp/f8x_error.log"

}

# -nodejsscan
nodejsscan_Install(){

    echo -e "\033[1;33m\n>> 正在检测 Docker 可用性\n\033[0m"
    Docker_Install

    echo -e "\033[1;33m\n>> 正在部署 nodejsscan 环境\n\033[0m"
    docker pull opensecurity/nodejsscan:latest && Echo_INFOR "已拉取最新版 nodejsscan 镜像, 请通过下列命令运行:\ndocker run -it -p 9090:9090 opensecurity/nodejsscan:latest\n\n-browser access：http://127.0.0.1:9090/" || Echo_ERROR "部署 nodejsscan 环境失败,请查看日志 /tmp/f8x_error.log"

}

# -viper
viper_Install(){

    echo -e "\033[1;33m\n>> 正在检测 Docker 可用性\n\033[0m"
    Docker_Install

    echo -e "\033[1;33m\n>> 正在部署 Viper 环境\033[0m"

    mkdir -p /root/VIPER && cd /root/VIPER && rm -f docker-compose.* 1> /dev/null 2>> /tmp/f8x_error.log

    viper_conf 1> /dev/null 2>> /tmp/f8x_error.log

    echo -e "\033[5;33m\n请输入 Viper 密码(密码需要大于8位)\033[0m" && read -r input
    Viper_Pass=$input
    cat docker-compose.yml.bak | sed "s/diypassword/$Viper_Pass/" >> docker-compose.yml
    cd /root/VIPER && docker-compose up -d

    Echo_INFOR "等待系统启动(15s),访问 https://vpsip:60000 登录服务器. 用户名:root 密码:$Viper_Pass "

}

viper_conf(){

tee docker-compose.yml.bak <<-'EOF'
version: "3"
services:
  viper:
    image: registry.cn-shenzhen.aliyuncs.com/toys/viper:latest
    container_name: viper-c
    network_mode: "host"
    restart: always
    volumes:
      - ${PWD}/loot:/root/.msf4/loot
      - ${PWD}/db:/root/viper/Docker/db
      - ${PWD}/module:/root/viper/Docker/module
      - ${PWD}/log:/root/viper/Docker/log
      - ${PWD}/nginxconfig:/root/viper/Docker/nginxconfig
    command: ["diypassword"]
EOF

}

# -arl
arl_Install(){

    echo -e "\033[1;33m\n>> 正在检测 Docker 可用性\n\033[0m"
    Docker_Install

    echo -e "\033[1;33m\n>> 正在部署 ARL 环境\n\033[0m"
    docker pull tophant/arl && Echo_INFOR "已拉取最新版 ARL 镜像 " || Echo_ERROR "部署 ARL 环境失败"

    cd $P_Dir && rm -rf ARL > /dev/null 2>&1 && $Porxy_OK git clone ${GitPorxy}https://github.com/TophantTechnology/ARL 1> /dev/null 2>> /tmp/f8x_error.log
    Echo_INFOR "输入 cd $P_Dir/ARL/docker/ && docker-compose up -d 启动, 默认端口 5003, 默认用户名密码 admin/arlpass"

}

# -music
music_Install(){

    nn_Check

    echo -e "\033[1;33m\n>> 正在部署 UnblockNeteaseMusic 服务\n\033[0m"
    Echo_ALERT "正在安装 npx 模块" && $Porxy_OK npm install npx -g 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "npx 模块安装完毕" || Echo_ERROR "npx 模块安装失败"
    cd $T_Dir && rm -rf UnblockNeteaseMusic > /dev/null 2>&1 && $Porxy_OK git clone ${GitPorxy}https://github.com/nondanee/UnblockNeteaseMusic > /dev/null 2>&1
    cd UnblockNeteaseMusic && $Porxy_OK npm install && Echo_INFOR "部署完毕,运行以下命令开启服务:\n\033[0m\033[1;32mcd $T_Dir/UnblockNeteaseMusic && npx @nondanee/unblockneteasemusic\n" || Echo_ERROR "部署失败"

    Echo_ALERT "若无法正常访问,请检查服务器防火墙设置"
}

# -nginx
nginx_Install(){

    echo -e "\033[1;33m\n>> 正在部署 nginx 服务\n\033[0m"

    name="nginx"
    nginx -h > /dev/null 2>&1

    if [ $? == 0 ]
    then
        Echo_ALERT "已安装 $name 环境"
    else

        Rm_Lock
        case $Linux_Version in
            *"CentOS"*|*"RedHat"*|*"Fedora"*)
                Install_Switch "pcre-devel"
                ;;
            *"Kali"*|*"Ubuntu"*|*"Debian"*)
                Install_Switch "libpcre3-dev"
                ;;
            *) ;;
        esac

        cd /tmp && rm -f $nginx_bin > /dev/null 2>&1 && $Porxy_OK wget https://nginx.org/download/$nginx_bin > /dev/null 2>&1 || Echo_ERROR "$nginx_bin 下载失败! 请检查 proxychains4 配置的代理服务器是否可用"
        tar -zxvf $nginx_bin > /dev/null 2>&1 && rm -f $nginx_bin > /dev/null 2>&1 && cd nginx-*
        ./configure && make && make install && Echo_INFOR "编译成功" || Echo_ERROR "编译失败"
        mv --force /usr/local/nginx/sbin/nginx /usr/local/bin/nginx && chmod +x /usr/local/bin/nginx && nginx -h > /dev/null 2>&1 && Echo_INFOR "$name 安装成功,配置文件在 /usr/local/nginx/conf/ 中,运行 nginx 即可" || Echo_ERROR "$name 安装失败"
    fi

}

# -aircrack
aircrack_Install(){

    echo -e "\033[1;33m\n>> 正在部署 aircrack-ng 环境\n\033[0m"

    name="aircrack-ng"
    dir="$P_Dir/aircrack-ng"

    if test -d $dir
    then
        Echo_ALERT "$name 已下载在 $dir"
    else
        cd $P_Dir && rm -rf aircrack-ng > /dev/null 2>&1 && $Porxy_OK git clone ${GitPorxy}https://github.com/aircrack-ng/aircrack-ng.git > /dev/null 2>&1 && cd $dir || Echo_ERROR2

        Rm_Lock
        case $Linux_Version in
            *"CentOS"*|*"RedHat"*)
                Update_EPEL_Mirror
                case $Linux_Version_Num in
                    8)
                        yum config-manager --set-enabled powertools
                        Install_Switch "libtool"
                        Install_Switch "pkgconfig sqlite-devel"
                        Install_Switch "autoconf"
                        Install_Switch "automake"
                        Install_Switch "openssl-devel"
                        Install_Switch "libpcap-devel"
                        Install_Switch "pcre-devel"
                        Install_Switch "rfkill"
                        Install_Switch "libnl3-devel"
                        Install_Switch "gcc"
                        Install_Switch "gcc-c++"
                        Install_Switch "ethtool"
                        Install_Switch "hwloc-devel"
                        Install_Switch "libcmocka-devl"
                        Install_Switch "make"
                        Install_Switch "file"
                        Install_Switch "expect"
                        Install_Switch "hostapd"
                        Install_Switch "wpa_supplicant"
                        Install_Switch "iw"
                        Install_Switch "usbutils"
                        Install_Switch "tcpdump"
                        Install_Switch "screen"
                        Install_Switch "zlib-devel"
                        ;;
                    7)
                        ./centos_autotools.sh
                        yum remove -y autoconf automake
                        Install_Switch "sqlite-devel"
                        Install_Switch "openssl-devel"
                        Install_Switch "libpcap-devel"
                        Install_Switch "pcre-devel"
                        Install_Switch "rfkill"
                        Install_Switch "libnl3-devel"
                        Install_Switch "ethtool"
                        Install_Switch "hwloc-devel"
                        Install_Switch "libcmocka-devel"
                        Install_Switch "make"
                        Install_Switch "file"
                        Install_Switch "expect"
                        Install_Switch "hostapd"
                        Install_Switch "wpa_supplicant"
                        Install_Switch "iw"
                        Install_Switch "usbutils"
                        Install_Switch "tcpdump"
                        Install_Switch "screen"
                        Install_Switch "zlib-devel"
                        ;;
                    *)
                        Echo_ERROR "版本不支持,pass"
                        ;;
                esac
                ;;
            *"Fedora"*)
                Install_Switch "libtool"
                Install_Switch "pkgconfig"
                Install_Switch "sqlite-devel"
                Install_Switch "autoconf"
                Install_Switch "automake"
                Install_Switch "openssl-devel"
                Install_Switch "libpcap-devel"
                Install_Switch "pcre-devel"
                Install_Switch "rfkill"
                Install_Switch "libnl3-devel"
                Install_Switch "gcc"
                Install_Switch "gcc-c++"
                Install_Switch "ethtool"
                Install_Switch "hwloc-devel"
                Install_Switch "libcmocka-devel"
                Install_Switch "make"
                Install_Switch "file"
                Install_Switch "expect"
                Install_Switch "hostapd"
                Install_Switch "wpa_supplicant"
                Install_Switch "iw"
                Install_Switch "usbutils"
                Install_Switch "tcpdump"
                Install_Switch "screen"
                Install_Switch "zlib-devel"
                ;;
            *"Kali"*|*"Ubuntu"*|*"Debian"*)
                Install_Switch "build-essential"
                Install_Switch "autoconf"
                Install_Switch "automake"
                Install_Switch "libtool"
                Install_Switch "pkg-config"
                Install_Switch "libnl-3-dev"
                Install_Switch "libnl-genl-3-dev"
                Install_Switch "libssl-dev"
                Install_Switch "ethtool"
                Install_Switch "shtool"
                Install_Switch "rfkill"
                Install_Switch "zlib1g-dev"
                Install_Switch "libpcap-dev"
                Install_Switch "libsqlite3-dev"
                Install_Switch "libpcre3-dev"
                Install_Switch "libhwloc-dev"
                Install_Switch "libcmocka-dev"
                Install_Switch "hostapd"
                Install_Switch "wpasupplicant"
                Install_Switch "tcpdump"
                Install_Switch "screen"
                Install_Switch "iw"
                Install_Switch "usbutils"
                ;;
            *) ;;
        esac

        ./autogen.sh && ./configure && make && make install && ldconfig && Echo_INFOR "已安装 $name 环境 " || Echo_ERROR "安装 $name 环境失败"

    fi

}

# -bypass
bypass_Install(){

    echo -e "\033[1;33m\n>> 正在检测 go 可用性\n\033[0m"
    go version 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "go 可用" || ( Echo_ALERT "依赖项不通过,即将自动安装 go" && Go_Install )

    Pentest_Base_Install

    echo -e "\033[1;33m\n>> 正在安装 garble\n\033[0m"
    go env -w GO111MODULE=on
    go get mvdan.cc/garble 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 garble 在 $P_Dir/garble " || Echo_ERROR "安装 garble 失败,请查看日志 /tmp/f8x_error.log"

    echo -e "\033[1;33m\n>> 正在安装 intensio-obfuscator\n\033[0m"
    Install_Switch5 "intensio-obfuscator"

}

# -cs
cs_Install(){

    Pentest_Base_Install

    echo -e "\033[1;33m\n>> 正在部署 CobaltStrike 4.1 环境\n\033[0m"
    Pentest_CobaltStrike_Install
    echo -e "\033[5;33m\n请输入你的 teamserver 服务端 IP\033[0m" && read -r input
    CS_IP=$input
    echo -e "\033[5;33m\n请输入你的 teamserver 服务端密码(特殊字符请在前面加反斜杠 \"\\\" 转义)\033[0m" && read -r input
    CS_Pass=$input
    Echo_INFOR "请新建一个窗口会话,运行以下命令:\n\033[0m\033[1;32mcd $P_Dir/$CS_Version/ && nohup ./teamserver $CS_IP $CS_Pass & "

}

# -frp
frp_Install(){

    echo -e "\033[1;33m\n>> 正在部署 frp 环境\n\033[0m"

    name="frp"

    cd $T_Dir && rm -rf frp* > /dev/null 2>&1 && $Porxy_OK wget ${GitPorxy}https://github.com/fatedier/frp/releases/download/$frp_Version/$frp_File > /dev/null 2>&1 || Echo_ERROR "$frp_File 下载失败! 请检查 proxychains4 配置的代理服务器是否可用"
    tar -zxvf $frp_File > /dev/null 2>&1 && rm -f $frp_File > /dev/null 2>&1
    cd $frp_Dir && Echo_INFOR "frp 已部署在 $T_Dir/$frp_Dir" || Echo_ERROR "frp 部署失败\n"

}

# -nps
nps_Install(){

    echo -e "\033[1;33m\n>> 正在部署 nps 环境\n\033[0m"

    name="nps"

    if test -d $T_Dir/nps
    then
        Echo_INFOR "nps 已部署在 $T_Dir/nps"
    else
        mkdir -p $T_Dir/nps
        cd $T_Dir/nps && $Porxy_OK wget ${GitPorxy}https://github.com/ehang-io/nps/releases/download/$nps_Ver/$nps_Install > /dev/null 2>&1 || Echo_ERROR "$nps_Install 下载失败! 请检查 proxychains4 配置的代理服务器是否可用"
        tar -zxvf $nps_Install 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "解压 $T_Dir/$nps_Install 失败,请查看日志 /tmp/f8x_error.log"
        rm -f $T_Dir/nps/$nps_Install > /dev/null 2>&1 && chmod +x $T_Dir/nps/nps && $T_Dir/nps/nps install > /dev/null 2>&1
        $T_Dir/nps/nps -version 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 nps $nps_Ver 在 $T_Dir/nps 目录下,直接输入 $T_Dir/nps/nps 即可使用" || Echo_ERROR "nps 安装失败,请查看日志 /tmp/f8x_error.log"
    fi

}

# -suricata
suricata_Install(){

    echo -e "\033[1;33m\n>> 正在部署 suricata 环境\n\033[0m"

    case $Linux_Version in
        *"CentOS"*|*"RedHat"*|*"Fedora"*)
            Echo_ERROR "目前脚本仅支持 Debian 系安装 suricata,bye bye~\n"
            exit 1
            ;;
        *"Kali"*|*"Ubuntu"*|*"Debian"*)
            Rm_Lock
            add-apt-repository ppa:oisf/suricata-stable
            Install_Switch "jq"
            Install_Switch "suricata"
            Install_Switch "suricata-update"
            suricata-update && Echo_INFOR "已更新规则" || Echo_ERROR "更新规则失败"
            ;;
        *) ;;
    esac

}

# -ssr
ssr_Install(){

    echo -e "\033[1;33m\n>> 正在部署 ssr\n\033[0m"

    name="ssr"

    if test -d $T_Dir/shadowsocksr
    then
        Echo_ALERT "$name 已安装在 $T_Dir/shadowsocksr"
    else
        cd $T_Dir && rm -f ssr.zip > /dev/null 2>&1 && wget https://cdn.jsdelivr.net/gh/No-Github/Archive@1.0.3/ssr/ssr.zip > /dev/null 2>&1
        unzip -P 123456 ssr.zip 1> /dev/null 2>> /tmp/f8x_error.log && rm -f ssr.zip > /dev/null 2>&1
        cd shadowsocksr && bash initcfg.sh && Echo_INFOR "已部署 ssr" || Echo_ERROR "部署 ssr 失败,请查看日志 /tmp/f8x_error.log"
        Echo_INFOR "运行下列命令修改 ssr 配置:\n\033[0m\033[1;32mvim $T_Dir/shadowsocksr/user-config.json\n"
        Echo_INFOR "运行下列命令开启 ssr 服务:\n\033[0m\033[1;32mcd $T_Dir/shadowsocksr/shadowsocks/ && python local.py"
    fi

}

# -zsh
zsh_Install(){

    #case $Linux_Version in
    #    *"CentOS"*|*"RedHat"*|*"Fedora"*)
    #        Echo_ERROR "目前脚本仅支持 Debian 系安装 zsh ,bye bye~\n"
    #        exit 1
    #        ;;
    #esac

    echo -e "\033[1;33m\n>> 正在配置 zsh 环境\n\033[0m"

    Echo_INFOR "当前系统 shell 存在情况如下:"
    cat /etc/shells
    echo -e ""

    Echo_INFOR "当前默认 shell 为:"
    echo -e $SHELL
    echo -e ""

    zsh --version 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "zsh 已安装"
    else
        Rm_Lock
        Echo_INFOR "正在安装 zsh"
        Install_Switch "zsh"
    fi

    Echo_INFOR "正在配置 Oh My Zsh"

    if [ $Porxy_OK == proxychains4 ]
    then
        $Porxy_OK wget https://raw.githubusercontent.com/No-Github/Archive/master/zsh/install.sh > /dev/null 2>&1
        $Porxy_OK bash install.sh
        $Porxy_OK exec zsh -l
    else
        wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh > /dev/null 2>&1
        Echo_INFOR "请在看到 ➜  ~  时手动输入 exit 退出子 shell 环境继续安装"
        sleep 1
        bash install.sh
    fi

    cat ~/.zshrc | sed "s/robbyrussell/agnoster/" >> ~/.zshrc

    $Porxy_OK git clone ${GitPorxy}https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
    cat ~/.zshrc | sed "s/git/git zsh-syntax-highlighting/" >> ~/.zshrc

    $Porxy_OK git clone ${GitPorxy}https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
    echo 'source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh' >>~/.zshrc

    echo -e "\033[1;33m\n>> 是否需要配置 powerlevel10k 主题 [Y/n,默认Yes] \033[0m" && read -r input
    case $input in
        [nN][oO]|[nN])
            Echo_INFOR "Pass~"
            ;;
        *)
            $Porxy_OK git clone ${GitPorxy}--depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
            echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc
            Echo_ALERT "如果不需要,可以删除 ~/.zshrc 文件中最后几行 powerlevel10k 的配置"
            ;;
    esac

    Echo_INFOR "完毕! 请重开一个 shell 看下效果哦~ "

}

# -optimize
optimize_setting(){

    echo -e "\033[1;33m\n>> 正在同步\n\033[0m"
    sync && Echo_INFOR "sync"
    echo -e "\033[1;33m\n>> 正在释放缓存\n\033[0m"
    echo 1 > /proc/sys/vm/drop_caches && Echo_INFOR "已清理 pagecache(页面缓存)"
    echo 2 > /proc/sys/vm/drop_caches && Echo_INFOR "已清理 dentries(目录缓存)和inodes"
    echo 3 > /proc/sys/vm/drop_caches && Echo_INFOR "已清理 pagecache、dentries 和 inodes"
    sync
    echo -e "\033[1;33m\n>> 正在取消开启文件数限制\n\033[0m"
    ulimit -n 65535 && Echo_INFOR "ulimit -n 65535"
    echo -e "\033[1;33m\n>> 正在优化内存设置\n\033[0m"
    echo 128 > /proc/sys/vm/nr_hugepages 1> /dev/null 2>> /tmp/f8x_error.log
    sysctl -w vm.nr_hugepages=128 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "vm.nr_hugepages=128"

}

# -info
System_info(){

    rm -f /tmp/f8x_info.log > /dev/null 2>&1

    date +"%Y-%m-%d" > /tmp/f8x_info.log

    echo -e "\033[1;33m\n>> 系统信息\n\033[0m"

    Echo_INFOR "当前用户:"
    w

    echo -e "" && Echo_INFOR "当前系统管理员用户:"
    awk -F: '($3 == "0") {print}' /etc/passwd

    echo -e "" && Echo_INFOR "近几次登录情况:"
    last
##############################
    echo -e "\033[1;33m\n>> 硬件信息\n\033[0m"

    Echo_INFOR "当前内核版本:"
    uname -r

    echo -e "" && Echo_INFOR "当前 CPU 型号:"
    cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq

    echo -e "" && Echo_INFOR "当前 CPU 使用情况:"
    uptime

    awk '$0 ~/cpu[0-9]/' /proc/stat 2>/dev/null | while read line; do
	echo "$line" | awk '{total=$2+$3+$4+$5+$6+$7+$8;free=$5;\
        print$1" Free "free/total*100"%",\
        "Used " (total-free)/total*100"%"}'
    done

    echo -e "" && Echo_INFOR "当前 CPU 核数:"
    cat /proc/cpuinfo | grep 'processor' | sort | uniq | wc -l
##############################
    echo -e "\033[1;33m\n>> 资源占用\n\033[0m"

    Echo_INFOR "当前内存使用情况:"
    free -h

    echo -e "" && Echo_INFOR "使用 CPU 资源最多的10个进程:"
    ps auxf |sort -nr -k 3 |head -10

    echo -e "" && Echo_INFOR "使用内存资源最多的10个进程:"
    ps auxf |sort -nr -k 4 |head -10

    echo -e "" && Echo_INFOR "磁盘空间利用率:"
    df -h

    echo -e "" && Echo_INFOR "可用块设备信息:"
    lsblk

    echo -e "" && Echo_INFOR "当前 swap 分区使用情况: (为空则代表没有配置 swap 分区)"
    swapon -s 2>> /tmp/f8x_error.log

    echo -e "" && Echo_INFOR "挂载状态:"
    more /etc/fstab  | grep -v "^#" | grep -v "^$"
##############################
    echo -e "\033[1;33m\n>> 网络状态\n\033[0m"

    Echo_INFOR "当前 IP 地址:"
    ip addr | grep inet | grep -v "inet6" | grep -v "127.0.0.1" | awk '{ print $2; }' | tr '\n' '\t'

    echo -e "\n" && Echo_INFOR "当前 TCP 连接:"
    cat  /proc/net/tcp | wc -l

    echo -e "" && Echo_INFOR "当前路由表:"
    ip route 2>> /tmp/f8x_error.log || route -n 2>> /tmp/f8x_error.log

    echo -e "" && Echo_INFOR "监听端口:"
    netstat -tunlp 2>> /tmp/f8x_error.log || ss -tnlp 2>> /tmp/f8x_error.log

    echo -e "" && Echo_INFOR "路由转发状态:"
    ip_forward=$(more /proc/sys/net/ipv4/ip_forward | awk -F: '{if ($1==1) print "1"}')
    if [ -n "$ip_forward" ]; then
        echo "已开启路由转发"
    else
        echo "未开启路由转发"
    fi
##############################
    echo -e "\033[1;33m\n>> 身份信息\n\033[0m"

    Echo_INFOR "系统所有用户:"
    echo -e "\n\n\n>> 系统所有用户: " >> /tmp/f8x_info.log
    cut -d: -f1 /etc/passwd >> /tmp/f8x_info.log && echo -e "由于回显较多,已输出至 /tmp/f8x_info.log"

    echo -e "" && Echo_INFOR "系统超级用户:"
    grep -v -E "^#" /etc/passwd | awk -F: '$3 == 0 { print $1}'

    echo -e "" && Echo_INFOR "可以远程登录的帐号信息:"
    awk '/\$1|\$6/{print $1}' /etc/shadow

    echo -e "" && Echo_INFOR "系统所有组:"
    echo -e "\n\n\n>> 系统所有组: " >> /tmp/f8x_info.log
    cut -d: -f1,2,3 /etc/group >> /tmp/f8x_info.log && echo -e "由于回显较多,已输出至 /tmp/f8x_info.log"

    echo -e "" && Echo_INFOR "开机启动的服务:"
    echo -e "\n\n\n>> 开机启动的服务: " >> /tmp/f8x_info.log
    systemctl list-unit-files | grep enabled >> /tmp/f8x_info.log && echo -e "由于回显较多,已输出至 /tmp/f8x_info.log"

    echo -e "" && Echo_INFOR "当前用户的计划任务:"
    crontab -l

    echo -e "" && Echo_INFOR "当前登陆用户的资源限制情况:"
    ulimit -a

##############################
    echo -e "\033[1;33m\n>> 安全信息\033[0m"

    echo -e "" && Echo_INFOR "环境变量:"
    echo -e "\n\n\n>> 环境变量: " >> /tmp/f8x_info.log
    env >> /tmp/f8x_info.log && echo -e "已输出至 /tmp/f8x_info.log"

    case $Linux_Version in
        *"CentOS"*|*"RedHat"*|*"Fedora"*)
            echo -e "" && Echo_INFOR "检查所有的 rpm 软件包，查看哪些命令被替换了:"
            rpm -Va
            ;;
        *"Kali"*|*"Ubuntu"*|*"Debian"*)
            echo -e "" && Echo_INFOR "查看仓库密钥:"
            echo -e "\n\n\n>> 查看仓库密钥: " >> /tmp/f8x_info.log
            apt-key list 1>> /tmp/f8x_info.log 2>> /tmp/f8x_error.log && echo -e "已输出至 /tmp/f8x_info.log"
            ;;
    esac

}

# -clear
clear_log(){

    echo -e "\033[1;33m\n>> 正在清理系统使用痕迹\n\033[0m"
    cat /dev/null > /var/log/boot.log && Echo_INFOR "cat /dev/null > /var/log/boot.log"
    cat /dev/null > /var/log/btmp && Echo_INFOR "cat /dev/null > /var/log/btmp"
    cat /dev/null > /var/log/cron && Echo_INFOR "cat /dev/null > /var/log/cron"
    cat /dev/null > /var/log/dmesg && Echo_INFOR "cat /dev/null > /var/log/dmesg"
    cat /dev/null > /var/log/firewalld && Echo_INFOR "cat /dev/null > /var/log/firewalld"
    cat /dev/null > /var/log/grubby && Echo_INFOR "cat /dev/null > /var/log/grubby"
    cat /dev/null > /var/log/lastlog && Echo_INFOR "cat /dev/null > /var/log/lastlog"
    cat /dev/null > /var/log/mail.info && Echo_INFOR "cat /dev/null > /var/log/mail.info"
    cat /dev/null > /var/log/maillog && Echo_INFOR "cat /dev/null > /var/log/maillog"
    cat /dev/null > /var/log/messages && Echo_INFOR "cat /dev/null > /var/log/messages"
    cat /dev/null > /var/log/secure && Echo_INFOR "cat /dev/null > /var/log/secure"
    cat /dev/null > /var/log/spooler && Echo_INFOR "cat /dev/null > /var/log/spooler"
    cat /dev/null > /var/log/syslog && Echo_INFOR "cat /dev/null > /var/log/syslog"
    cat /dev/null > /var/log/tallylog && Echo_INFOR "cat /dev/null > /var/log/tallylog"
    cat /dev/null > /var/log/wpa_supplicant.log && Echo_INFOR "cat /dev/null > /var/log/wpa_supplicant.log"
    cat /dev/null > /var/log/wtmp && Echo_INFOR "cat /dev/null > /var/log/wtmp"
    cat /dev/null > /var/log/yum.log && Echo_INFOR "cat /dev/null > /var/log/yum.log"
    history -c
    Echo_INFOR "清理完毕"

}

# -remove
remove_watcher(){

    echo -e "\033[1;33m\n>> 正在卸载国内 vps 云监控\n\033[0m"

    if ps aux | grep -i '[a]liyun'
    then
        wget http://update.aegis.aliyun.com/download/uninstall.sh && chmod +x uninstall.sh && ./uninstall.sh
        wget http://update.aegis.aliyun.com/download/quartz_uninstall.sh && chmod +x quartz_uninstall.sh && ./quartz_uninstall.sh

        # 删除残留
        sudo pkill aliyun-service
        sudo rm -fr /etc/init.d/agentwatch /usr/sbin/aliyun-service
        sudo rm -rf /usr/local/aegis*
        systemctl stop aliyun.service
        systemctl disable aliyun.service

        # 屏蔽云盾 IP，用包过滤屏蔽如下 IP
        iptables -I INPUT -s 140.205.201.0/28 -j DROP
        iptables -I INPUT -s 140.205.201.16/29 -j DROP
        iptables -I INPUT -s 140.205.201.32/28 -j DROP
        iptables -I INPUT -s 140.205.225.192/29 -j DROP
        iptables -I INPUT -s 140.205.225.200/30 -j DROP
        iptables -I INPUT -s 140.205.225.184/29 -j DROP
        iptables -I INPUT -s 140.205.225.183/32 -j DROP
        iptables -I INPUT -s 140.205.225.206/32 -j DROP
        iptables -I INPUT -s 140.205.225.205/32 -j DROP
        service iptables save
        service iptables restart

        # 卸载云监控 Java 版本插件
        sudo /usr/local/cloudmonitor/wrapper/bin/cloudmonitor.sh stop
        sudo /usr/local/cloudmonitor/wrapper/bin/cloudmonitor.sh remove
        sudo rm -rf /usr/local/cloudmonitor
    elif ps aux | grep -i '[y]unjing'
    then
        /usr/local/qcloud/stargate/admin/uninstall.sh
        /usr/local/qcloud/YunJing/uninst.sh
        /usr/local/qcloud/monitor/barad/admin/uninstall.sh
    fi

    rm -rf /usr/local/qcloud/
    rm -rf /usr/local/sa/
    rm -rf /usr/local/agenttools

    Echo_INFOR "卸载完毕"

}

# -swap
swap_setting(){

    echo -e "\033[1;33m\n>> 正在进行 swap 分区配置\n\033[0m"
    Echo_INFOR "当前 swap 分区使用情况如下: (为空则代表没有配置 swap 分区)"
    swapon -s 2>> /tmp/f8x_error.log

    if test -e /home/f8xswap
    then
        Echo_ALERT "/home/f8xswap 文件已存在"
        exit 1
    fi

    echo -e "\033[5;33m\n请输入 swap 分区的大小(单位为G) [默认为 4G]\033[0m" && read -r input

    VALID_CHECK=$(echo "$input"|awk -F. '$1>0&&$1<=254{print "yes"}')
    if [ "${VALID_CHECK:-no}" == "yes" ]; then
        echo -e "\033[1;32m\n>> ${input}G\033[0m"
        swap_bin=`expr ${input} \* 1024`
    else
        echo -e "\033[1;32m\n>> 将使用默认大小\033[0m"
        swap_bin="4096"
    fi

    echo -e "\033[1;33m\n>> 正在创建 swap 文件,时间随大小而定,稍等\n\033[0m"
    dd if=/dev/zero of=/home/f8xswap bs=1M count=$swap_bin && Echo_INFOR "已创建 swap 文件在 /home/f8xswap"
    mkswap /home/f8xswap 1> /dev/null
    swapon /home/f8xswap 1> /dev/null && Echo_INFOR "已挂载文件分区 /home/f8xswap"
    echo -e "\n/home/f8xswap swap swap default 0 0" >> /etc/fstab
    Echo_INFOR "当前swap 分区使用情况如下: (为空则代表没有配置 swap 分区)"
    swapon -s 2>> /tmp/f8x_error.log

}

# -asciinema
asciinema_Install(){

    echo -e "\033[1;33m\n>> 正在安装 asciinema\n\033[0m"

    name="asciinema"
    asciinema --version 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        pip3 install asciinema 1> /dev/null 2>> /tmp/f8x_error.log

        if [ $? == 0 ]
        then
            Echo_INFOR "已安装 $name"
        else
            Echo_ERROR "pip3 安装 $name 失败,即将切换到包管理器安装"
            Rm_Lock
            Install_Switch "asciinema"
        fi

    fi
    Echo_INFOR "运行以下命令开启截图:"
    Echo_INFOR "asciinema rec"

}

# -bt
bt_Install(){

    echo -e "\033[1;33m\n>> 正在部署宝塔 Linux 面板\n\033[0m"

    case $Linux_Version in
        *"CentOS"*|*"RedHat"*|*"Fedora"*)
            cd /tmp && curl -o install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
            ;;
        *"Kali"*|*"Ubuntu"*|*"Debian"*)
            cd /tmp && curl -o install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh
            ;;
        *) ;;
    esac

}

# -clash
clash_Install(){

    echo -e "\033[1;33m\n>> 正在安装 clash\n\033[0m"

    name="clash"
    clash -v 1> /dev/null 2>> /tmp/f8x_error.log

    if [ $? == 0 ]
    then
        Echo_ALERT "$name 已安装"
    else
        cd /tmp && rm -f $clash_bin > /dev/null 2>&1 && wget https://github.ffffffff0x.com/https://github.com/Dreamacro/clash/releases/download/$clash_Ver/$clash_bin > /dev/null 2>&1 || Echo_ERROR "$clash_bin 下载失败"
        gunzip $clash_bin && mv clash-linux-amd64-v1.4.2 /usr/local/bin/clash && chmod +x /usr/local/bin/clash

        clash -v 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "已安装 $name" || Echo_ERROR3
    fi

    echo -e "\033[1;33m\n>> 是否需要配置 Clash 托管链接 [Y/n,默认Yes] \033[0m" && read -r input
    case $input in
        [nN][oO]|[nN])
            Echo_INFOR "Pass~"
            ;;
        *)
            mv --force ~/.config/clash/config.yaml ~/.config/clash/config.yaml.bak
            echo -e "\033[5;33m请粘贴 Clash 托管链接地址\033[0m" && read -r input
            wget -O ~/.config/clash/config.yaml $input > /dev/null 2>&1
            Echo_INFOR "完毕! 请运行 clash 然后访问 http://clash.razord.top 进行策略组设置，具体端口和口令请按 yml 文件中的 external-controller 内容输入"
            ;;
    esac

}

# -all
all_Install(){

    Base_Install

    optimize_setting

    Dev_Tools

    Oraclejdk_Install

    nn_Install

    kali_Tools

    frp_Install

    nps_Install

}

# -d
Dev_Tools(){

    Dev_Base_Install
    echo -e "\033[1;33m\n>> 正在安装 python3 和 pip3\n\033[0m"
    Python3_Install
    Python2_Install
    echo -e "\033[1;33m\n>> 正在安装 Go\n\033[0m"
    Go_Install
    echo -e "\033[1;33m\n>> 正在安装 Docker 和 Docker-compose\n\033[0m"
    Docker_Install
    echo -e "\033[1;33m\n>> 正在安装 SDKMAN!\n\033[0m"
    SDKMAN_Install

}

# -f
Fun_Tools(){

    echo -e "\033[1;33m\n>> 正在开启嘴臭功能\n\033[0m"
    Bash_Insulter
    echo -e "\033[1;33m\n>> 正在躲避微软法务部追杀\n\033[0m"
    vlmcsd_Install
    echo -e "\033[1;33m\n>> 正在部署 AdguardTeam DNS\n\033[0m"
    AdguardTeam_Install
    echo -e "\033[1;33m\n>> 正在部署 trash-cli\n\033[0m"
    trash-cli_Install
    echo -e "\033[1;33m\n>> 正在安装 thefuck\n\033[0m"
    thefuck_Install
    echo -e "\033[1;33m\n>> 正在安装 fzf\n\033[0m"
    fzf_Install
    echo -e "\033[1;33m\n>> 正在安装 annie\n\033[0m"
    annie_Install
    echo -e "\033[1;33m\n>> 正在安装 you-get\n\033[0m"
    you-get_Install
    echo -e "\033[1;33m\n>> 正在安装 ffmpeg\n\033[0m"
    ffmpeg_Install
    echo -e "\033[1;33m\n>> 正在安装 aria2\n\033[0m"
    aria2_Install
    echo -e "\033[1;33m\n>> 正在安装 filebrowser\n\033[0m"
    filebrowser_Install
    echo -e "\033[1;33m\n>> 正在安装 sharry\n\033[0m"
    sharry_Install
    echo -e "\033[1;33m\n>> 正在安装 starship\n\033[0m"
    starship_Install

}

# -k
kali_Tools(){

    echo -e "\033[1;33m\n>> 正在配置渗透环境\n\033[0m"
    Pentest_Base_Install
    echo -e "\033[1;33m\n>> 正在从 github 下载 AboutSecurity 字典库 \n\033[0m"
    Pentest_Dic_Install
    echo -e "\033[1;33m\n>> 正在安装一些杂项工具\n\033[0m"
    Pentest_Misc_Install
    echo -e "\033[1;33m\n>> 正在安装一些 python 模块\n\033[0m"
    Pentest_pip_Install
    echo -e "\033[1;33m\n>> 正在安装 hashcat、7z2hashcat\n\033[0m"
    Pentest_hashcat_Install
    echo -e "\033[1;33m\n>> 正在安装 nmap\n\033[0m"
    Pentest_nmap_Install
    echo -e "\033[1;33m\n>> 正在安装 ncat\n\033[0m"
    Pentest_ncat_Install
    echo -e "\033[1;33m\n>> 正在安装 ffuf\n\033[0m"
    Pentest_ffuf_Install
    echo -e "\033[1;33m\n>> 正在安装 JSFinder\n\033[0m"
    Pentest_JSFinder_Install
    echo -e "\033[1;33m\n>> 正在安装 SecretFinder\n\033[0m"
    Pentest_SecretFinder_Install
    #echo -e "\033[1;33m\n>> 正在安装 WebAliveScan\n\033[0m"
    #Pentest_WebAliveScan_Install
    echo -e "\033[1;33m\n>> 正在安装 OneForAll\n\033[0m"
    Pentest_OneForAll_Install
    echo -e "\033[1;33m\n>> 正在安装 ksubdomain\n\033[0m"
    Pentest_ksubdomain_Install
    echo -e "\033[1;33m\n>> 正在安装 impacket\n\033[0m"
    Pentest_Impacket_Install
    echo -e "\033[1;33m\n>> 正在部署 CobaltStrike\n\033[0m"
    Pentest_CobaltStrike_Install
    echo -e "\033[1;33m\n>> 正在部署/更新 Metasploit 框架\n\033[0m"
    Pentest_Metasploit_Install
    echo -e "\033[1;33m\n>> 正在安装 Sqlmap\n\033[0m"
    Pentest_Sqlmap_Install
    echo -e "\033[1;33m\n>> 正在安装 RustScan\n\033[0m"
    Pentest_RustScan_Install
    echo -e "\033[1;33m\n>> 正在安装 WAFW00F\n\033[0m"
    Pentest_WAFW00F_Install
    echo -e "\033[1;33m\n>> 正在安装 xray\n\033[0m"
    Pentest_xray_Install
    echo -e "\033[1;33m\n>> 正在安装 masscan\n\033[0m"
    Pentest_masscan_Install
    echo -e "\033[1;33m\n>> 正在安装 fscan\n\033[0m"
    Pentest_fscan_Install
    echo -e "\033[1;33m\n>> 正在安装 pocsuite3\n\033[0m"
    Pentest_pocsuite3_Install
    echo -e "\033[1;33m\n>> 正在安装 Nuclei\n\033[0m"
    Pentest_Nuclei_Install
    echo -e "\033[1;33m\n>> 正在安装 rad\n\033[0m"
    Pentest_rad_Install
    echo -e "\033[1;33m\n>> 正在安装 crawlergo\n\033[0m"
    Pentest_crawlergo_Install
    echo -e "\033[1;33m\n>> 正在安装 w13scan\n\033[0m"
    Pentest_w13scan_Install
    echo -e "\033[1;33m\n>> 正在安装 Responder\n\033[0m"
    Pentest_Responder_Install
    echo -e "\033[1;33m\n>> 正在安装 krbrelayx\n\033[0m"
    Pentest_krbrelayx_Install
    echo -e "\033[1;33m\n>> 正在安装 Girsh\n\033[0m"
    Pentest_Girsh_Install
    echo -e "\033[1;33m\n>> 正在安装 ApkAnalyser\n\033[0m"
    Pentest_ApkAnalyser_Install
    echo -e "\033[1;33m\n>> 正在安装 commix\n\033[0m"
    Pentest_commix_Install
    echo -e "\033[1;33m\n>> 正在安装 exploitdb 库\n\033[0m"
    Pentest_exploitdb_Install
    echo -e "\033[1;33m\n>> 正在安装 tplmap\n\033[0m"
    Pentest_tplmap_Install
    echo -e "\033[1;33m\n>> 正在安装 routersploit\n\033[0m"
    Pentest_routersploit_Install
    echo -e "\033[1;33m\n>> 正在安装 bettercap\n\033[0m"
    Pentest_bettercap_Install
    echo -e "\033[1;33m\n>> 正在安装 mitmproxy\n\033[0m"
    Pentest_mitmproxy_Install
    echo -e "\033[1;33m\n>> 正在安装 naabu\n\033[0m"
    Pentest_naabu_Install
    echo -e "\033[1;33m\n>> 正在安装 proxify\n\033[0m"
    Pentest_proxify_Install
    echo -e "\033[1;33m\n>> 正在安装 pypykatz\n\033[0m"
    Pentest_pypykatz_Install
    echo -e "\033[1;33m\n>> 正在安装 CrackMapExec\n\033[0m"
    Pentest_CrackMapExec_Install
    echo -e "\033[1;33m\n>> 正在安装 httpx\n\033[0m"
    Pentest_httpx_Install
    echo -e "\033[1;33m\n>> 正在安装 subfinder\n\033[0m"
    Pentest_subfinder_Install
    echo -e "\033[1;33m\n>> 正在安装 mapcidr\n\033[0m"
    Pentest_mapcidr_Install
    echo -e "\033[1;33m\n>> 正在安装 apktool\n\033[0m"
    Pentest_apktool_Install
    #echo -e "\033[1;33m\n>> 正在安装 DarkEye\n\033[0m"
    #Pentest_DarkEye_Install
    echo -e "\033[1;33m\n>> 正在安装 OpenRedireX\n\033[0m"
    Pentest_OpenRedireX_Install
    echo -e "\033[1;33m\n>> 正在安装 gau\n\033[0m"
    Pentest_gau_Install
    echo -e "\033[1;33m\n>> 正在安装 apkleaks\n\033[0m"
    Pentest_apkleaks_Install
    echo -e "\033[1;33m\n>> 正在安装 jadx\n\033[0m"
    Pentest_jadx_Install
    echo -e "\033[1;33m\n>> 正在安装 Diggy\n\033[0m"
    Pentest_Diggy_Install
    echo -e "\033[1;33m\n>> 正在安装 CORScanner\n\033[0m"
    Pentest_CORScanner_Install
    echo -e "\033[1;33m\n>> 正在安装 swagger-exp\n\033[0m"
    Pentest_swagger-exp_Install
    echo -e "\033[1;33m\n>> 正在安装 swagger-hack\n\033[0m"
    Pentest_swagger-hack_Install
    echo -e "\033[1;33m\n>> 正在安装 shiro-exploit\n\033[0m"
    Pentest_shiro-exploit_Install
    echo -e "\033[1;33m\n>> 正在安装 ysoserial\n\033[0m"
    Pentest_ysoserial_Install
    echo -e "\033[1;33m\n>> 正在安装 remote-method-guesser\n\033[0m"
    Pentest_remote-method-guesser_Install
    echo -e "\033[1;33m\n>> 正在安装 SSRFmap\n\033[0m"
    Pentest_SSRFmap_Install
    echo -e "\033[1;33m\n>> 正在安装 See-SURF\n\033[0m"
    Pentest_See-SURF_Install
    echo -e "\033[1;33m\n>> 正在安装 testssl.sh\n\033[0m"
    Pentest_testssl_Install
    echo -e "\033[1;33m\n>> 正在安装 MassBleed\n\033[0m"
    Pentest_MassBleed_Install

}

# -b
Base_Install(){

    echo -e "\033[1;33m\n>> 正在安装基础工具\n\033[0m"
    Base_Tools

}

# -s
Secure(){

    echo -e "\033[1;33m\n>> 正在安装 Fail2Ban\n\033[0m"
    Secure_Fail2Ban_Install
    echo -e "\033[1;33m\n>> 正在安装 chkrootkit\n\033[0m"
    Secure_chkrootkit_Install
    echo -e "\033[1;33m\n>> 正在安装 rkhunter\n\033[0m"
    Secure_rkhunter_Install
    echo -e "\033[1;33m\n>> 正在安装 河马 webshell 查杀工具\n\033[0m"
    Secure_shellpub_Install
    echo -e "\033[1;33m\n>> 正在安装 anti-portscan\n\033[0m"
    Secure_anti_portscan_Install
    echo -e "\033[1;33m\n>> 正在安装 BruteShark\n\033[0m"
    Secure_BruteShark_Install

}

# -cloud
cloud(){

    echo -e "\033[1;33m\n>> 正在安装 Terraform\n\033[0m"
    Terraform_Install

    echo -e "\033[1;33m\n>> 是否继续安装 Serverless Framework? [y/N,默认No] \033[0m" && read -r input
    case $input in
        [yY][eE][sS]|[Yy])
            nn_Check
            echo -e "\033[1;33m\n>> 正在安装 Serverless Framework\n\033[0m"
            Serverless_Framework_Install
            ;;
        *)
            Echo_INFOR "Pass~"
            ;;
    esac

    echo -e "\033[1;33m\n>> 是否继续安装 wrangler? [y/N,默认No] \033[0m" && read -r input
    case $input in
        [yY][eE][sS]|[Yy])
            Rust_Check
            echo -e "\033[1;33m\n>> 正在安装 wrangler\n\033[0m"
            wrangler_Install
            ;;
        *)
            Echo_INFOR "Pass~"
            ;;
    esac

}

# -ssh
SSH(){

    echo -e "\033[1;33m\n>> 正在配置 SSH\n\033[0m"
    SSH_Tools

}

# -h
Help(){

    echo -e "\033[1;34m1. 批量化安装 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-b\033[0m \033[0;34m选项安装基本环境 \033[0m       \033[1;32m(gcc、make、git、vim、telnet、jq、unzip 等基本工具)\033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-p\033[0m \033[0;34m选项安装代理环境 \033[0m       \033[1;31m(警告:国外云服务器上不要用,会降速)\033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-d\033[0m \033[0;34m选项安装开发环境 \033[0m       \033[1;32m(python3、pip3、Go、Docker、Docker-Compose、SDKMAN)\033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-k\033[0m \033[0;34m选项安装渗透环境 \033[0m       \033[1;32m(hashcat、ffuf、OneForAll、ksubdomain、impacket 等渗透工具)\033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-s\033[0m \033[0;34m选项安装蓝队环境 \033[0m       \033[1;32m(Fail2Ban、chkrootkit、rkhunter、河马webshell查杀工具)\033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-f\033[0m \033[0;34m选项安装其他工具 \033[0m       \033[1;32m(Bash_Insulter、vlmcsd、AdguardTeam、trash-cli 等辅助工具)\033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-cloud\033[0m \033[0;34m选项安装云应用 \033[0m     \033[1;32m(Terraform、Serverless Framework、wrangler)\033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-all\033[0m \033[0;34m选项全自动化部署\033[0m      \033[1;32m(默认不走代理,兼容 CentOS7/8,Debain10/9,Ubuntu20/18,Fedora33)\033[0m"
    echo -e ""
    echo -e "\033[1;34m2. 开发环境 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-nn\033[0m \033[0;34m选项安装 npm & NodeJs 环境 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-oraclejdk\033[0m \033[0;34m选项安装 oraclejdk 环境 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-openjdk\033[0m \033[0;34m选项安装 openjdk 环境 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-python3\033[0m \033[0;34m选项安装 python3 环境 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-python2\033[0m \033[0;34m选项安装 python2 环境 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-pip2-f\033[0m \033[0;34m选项强制安装 pip2 环境 \033[0m         \033[1;33m(建议在 -python2 选项失败的情况下运行)\033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-perl\033[0m \033[0;34m选项安装 perl 环境 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-ruby\033[0m \033[0;34m选项安装 ruby 环境 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-rust\033[0m \033[0;34m选项安装 rust 环境 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-chromium\033[0m \033[0;34m选项安装 Chromium 环境 \033[0m       \033[1;33m(用于配合 -k 选项中的 rad、crawlergo) \033[0m"
    echo -e ""
    echo -e "\033[1;34m3. 蓝队服务 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-binwalk\033[0m \033[0;34m选项安装 binwalk 环境 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-binwalk-f\033[0m \033[0;34m选项强制安装 binwalk 环境 \033[0m   \033[1;33m(建议在 -binwalk 选项失败的情况下运行)\033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-clamav\033[0m \033[0;34m选项安装 ClamAV \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-hfish\033[0m \033[0;34m选项安装 HFish 蜜罐 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-lt\033[0m \033[0;34m选项部署 LogonTracer 环境 \033[0m          \033[1;33m(非超高配置机器不要部署,这个应用太吃配置了)\033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-suricata\033[0m \033[0;34m选项部署 Suricata 环境 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-vol\033[0m \033[0;34m选项安装 volatility \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-vol3\033[0m \033[0;34m选项安装 volatility3 \033[0m"
    echo -e ""
    echo -e "\033[1;34m4. 红队服务 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-aircrack\033[0m \033[0;34m选项部署 aircrack-ng 环境 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-bypass\033[0m \033[0;34m选项部署 Bypass 环境 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-cs\033[0m \033[0;34m选项部署 CobaltStrike 4.1 环境 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-frp\033[0m \033[0;34m选项部署 frp 环境 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-goby\033[0m \033[0;34m选项部署 Goby 环境 \033[0m               \033[1;33m(客户端需要图形化环境,服务端不需要)\033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-nps\033[0m \033[0;34m选项部署 nps 环境 \033[0m"
    #echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-poc\033[0m \033[0;34m选项部署 公开的 poc 库 \033[0m            \033[1;33m(内容较多)\033[0m"
    echo -e ""
    echo -e "\033[1;34m5. 基于 Docker 的环境部署\033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-arl\033[0m \033[0;34m选项部署 ARL 环境(872 MB)\033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-awvs13\033[0m \033[0;34m选项部署 AWVS13 环境(1.04 GB)\033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-mobsf\033[0m \033[0;34m选项部署 MobSF 环境(1.54 GB)\033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-nodejsscan\033[0m \033[0;34m选项部署 nodejsscan 环境(873 MB)\033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-viper\033[0m \033[0;34m选项部署 Viper 环境(2.1 GB)\033[0m\033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-vulhub\033[0m \033[0;34m选项部署 vulhub 环境(210 MB)\033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-vulfocus\033[0m \033[0;34m选项部署 vulfocus 环境(1.04 GB)\033[0m"
    echo -e ""
    echo -e "\033[1;34m6. 杂项服务 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-asciinema\033[0m \033[0;34m选项安装 asciinema \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-bt\033[0m \033[0;34m选项部署宝塔服务 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-clash\033[0m \033[0;34m选项安装 clash \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-music\033[0m \033[0;34m选项部署 UnblockNeteaseMusic 服务 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-nginx\033[0m \033[0;34m选项配置 nginx 服务 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-ssh\033[0m \033[0;34m选项配置 ssh 环境 \033[0m                \033[1;33m (RedHat 系默认可用,无需重复安装)\033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-ssr\033[0m \033[0;34m选项安装 ssr \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-zsh\033[0m \033[0;34m选项配置 zsh 环境 \033[0m"
    echo -e ""
    echo -e "\033[1;34m7. 其他 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-clear\033[0m \033[0;34m选项清理系统使用痕迹 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-info\033[0m \033[0;34m选项查看系统各项信息 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-optimize\033[0m \033[0;34m选项改善设备选项,优化性能 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-remove\033[0m \033[0;34m选项卸载国内 vps 云监控 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-rmlock\033[0m \033[0;34m选项运行除锁模块 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-swap\033[0m \033[0;34m选项配置 swap 分区 \033[0m"
    echo -e "\033[0;34m|- 使用\033[0m \033[1;34m-update\033[0m \033[0;34m选项更新 f8x \033[0m"
    echo -e ""
    echo -e "\033[1;37m脚本作者 r0fus0d ,需要添加工具支持或运行遇到问题欢迎提交 issue\033[0m"
    echo -e "\033[1;37m|- 感谢 the-fog 在开发过程中对我的折磨 \033[0m"
    echo -e "\033[1;37m|- 感谢 xidaner 在开发过程给出的无用建议 \033[0m"
    echo -e "\033[1;37m|- 感谢 RyuZU 在旁边表演喷火 \033[0m"
    echo -e "\033[1;37m|- ffffffff0x.com\033[0m"
    echo -e ""

}

# -p
Proxy(){

    echo -e "\033[1;33m\n>> 是否需要更新 DNS 服务器? [Y/n,默认Yes]\033[0m"
    Change_DNS_IP
    Mirror
    echo -e "\033[1;33m\n>> 正在安装 resolvconf\n\033[0m"
    DNS_T00ls
    echo -e "\033[1;33m\n>> 正在配置基础编译环境\n\033[0m"
    Proxychains_Install
    echo -e "\033[1;33m\n>> 正在配置 pip 代理\n\033[0m"
    pip_Proxy > /dev/null

    Echo_INFOR "已更新 pip 代理"

    echo -e "\033[1;33m\n>> 正在配置 docker 代理\n\033[0m"
    Docker_Proxy > /dev/null
    systemctl restart docker 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "重启 docker 服务失败!(若未安装 docker 可忽略报错)"
    systemctl daemon-reload 1> /dev/null 2>> /tmp/f8x_error.log || Echo_ERROR "重启加载 systemd 程序的配置文件失败!(可忽略报错)"

    Echo_INFOR "已更新 Docker 代理"

}

# -debug
Debug_Fun(){

    echo -e "自毁程序启动,倒数5分钟"

}

# Main
Main(){

case "$(uname)" in
    *"Darwin"*)
	    echo "不支持 mac 平台"
	    exit 1
        ;;
    *"MINGW64_NT"*)
        echo "不支持 windows 平台"
        exit 1
        ;;
esac

if [[ $UID != 0 ]]; then
    Echo_ERROR "请以sudo 或 root 权限账户运行!"
    exit 1
fi

setenforce 0 > /dev/null 2>&1

printf "\033c"

}

Main

if [ $GitPorxy ==  ] 2>> /tmp/f8x_error.log
then
    Banner
fi

Info

if [ $GitPorxy ==  ] 2>> /tmp/f8x_error.log
then
    Info2
    echo -e "\033[1;36m \n-----开始执行----- \033[0m"
    echo -e "\033[1;33m\n>> 正在初始化\n\033[0m"
    Base_Dir
    Docker_Check
fi

case "$1" in
    -b | b)
        Base_Install
        ;;
    -p | p)
        Proxy
        ;;
    -d | d)
        Porxy_Switch
        Base_Check
        Dev_Tools
        ;;
    -k | k)
        Porxy_Switch
        Base_Check
        Py_Check
        kali_Tools
        ;;
    -s | s)
        Porxy_Switch
        Base_Check
        Secure
        ;;
    -f | f)
        Porxy_Switch
        Base_Check
        pip3_Check
        Fun_Tools
        ;;
    -h | h)
        printf "\033c"
        Help
        ;;
    -cloud)
        Porxy_Switch
        Base_Check
        cloud
        ;;
    -all)
        all_Install
        ;;
    -nn)
        Porxy_Switch
        Base_Check
        nn_Install
        ;;
    -openjdk)
        Porxy_Switch
        Base_Check
        Openjdk_Install
        ;;
    -oraclejdk)
        Porxy_Switch
        Base_Check
        Oraclejdk_Install
        ;;
    -python3)
        Python3_Install
        ;;
    -python2)
        Python2_Install
        ;;
    -pip2-f)
        Porxy_Switch
        Base_Check
        pip2_Install
        ;;
    -perl)
        Porxy_Switch
        Base_Check
        Perl_Install
        ;;
    -ruby)
        Porxy_Switch
        Base_Check
        Ruby_Install
        ;;
    -rust)
        Porxy_Switch
        Base_Check
        Rust_Install
        ;;
    -chromium)
        Porxy_Switch
        Base_Check
        chromium_Install
        ;;
    -binwalk)
        Porxy_Switch
        Base_Check
        binwalk_Install
        ;;
    -binwalk-f)
        Porxy_Switch
        Base_Check
        binwalk_force_Install
        ;;
    -clamav)
        Porxy_Switch
        Base_Check
        clamav_Install
        ;;
    -vol)
        Porxy_Switch
        Base_Check
        pip2_Check
        Volatility_Install
        ;;
    -vol3)
        Porxy_Switch
        Base_Check
        pip3_Check
        volatility3_Install
        ;;
    -hfish)
        Porxy_Switch
        hfish_Install
        ;;
    -lt)
        Porxy_Switch
        lt_Install
        ;;
    -aircrack)
        Porxy_Switch
        Base_Check
        aircrack_Install
        ;;
    -bypass)
        Porxy_Switch
        Base_Check
        Py_Check
        bypass_Install
        ;;
    -cs)
        Porxy_Switch
        Base_Check
        cs_Install
        ;;
    -frp)
        Porxy_Switch
        Base_Check
        frp_Install
        ;;
    -goby)
        Porxy_Switch
        Base_Check
        Goby_Install
        ;;
    -nps)
        Porxy_Switch
        Base_Check
        nps_Install
        ;;
    -suricata)
        Porxy_Switch
        Base_Check
        suricata_Install
        ;;
    -arl)
        Porxy_Switch
        Pentest_Base_Install
        arl_Install
        ;;
    -awvs13)
        Porxy_Switch
        awvs13_Install
        ;;
    -mobsf)
        Porxy_Switch
        mobsf_Install
        ;;
    -nodejsscan)
        Porxy_Switch
        nodejsscan_Install
        ;;
    -viper)
        Porxy_Switch
        viper_Install
        ;;
    -vulhub)
        Porxy_Switch
        vulhub_Install
        ;;
    -vulfocus)
        Porxy_Switch
        vulfocus_Install
        ;;
    -asciinema)
        asciinema_Install
        ;;
    -bt)
        Base_Check
        bt_Install
        ;;
    -clash)
        Base_Check
        clash_Install
        ;;
    -music)
        Porxy_Switch
        Base_Check
        music_Install
        ;;
    -nginx)
        Porxy_Switch
        Base_Check
        nginx_Install
        ;;
    -ssh)
        SSH
        ;;
    -ssr)
        Base_Check
        ssr_Install
        ;;
    -zsh)
        Porxy_Switch
        Base_Check
        pip3_Check
        zsh_Install
        ;;
    -clear)
        clear_log
        ;;
    -info)
        Base_Check
        System_info
        ;;
    -optimize)
        optimize_setting
        ;;
    -remove)
        remove_watcher
        ;;
    -rmlock)
        Rm_Lock

        case $Linux_Version in
            *"Kali"*|*"Ubuntu"*|*"Debian"*)
                dpkg --configure -a > /dev/null 2>&1
                ;;
            *) ;;
        esac

        ;;
    -swap)
        swap_setting
        ;;
    -update)
        rm -f f8x && curl -o f8x https://cdn.jsdelivr.net/gh/ffffffff0x/f8x@main/f8x > /dev/null 2>&1 && Echo_INFOR "更新成功" || Echo_ERROR "更新失败"
        ;;
    -debug)
        Base_Check
        Pentest_Base_Install
        Porxy_Switch
        Debug_Fun
        ;;
    *)
        if [ $GitPorxy ==  ] 2>> /tmp/f8x_error.log
        then
            echo -e ""
            echo -e "\033[1;34m使用 -h 选项查看帮助文档 \033[0m"
        fi
        ;;
esac

if [ $GitPorxy ==  ] 2>> /tmp/f8x_error.log
then
    echo -e "\033[1;36m \n-----执行结束-----\n \033[0m"
fi